Dialogic® PowerMedia™ Extended Media Server (PowerMedia XMS) - more articles
How to create JAXB classes in Client Library using msml xsd file
This article explains how to generate the JAXB classes when using MSML functionalities in Client Library with Dialogic® PowerMedia™ XMS.
Client Library was developed to facilitate building sample applications and proof of concept demos, and to reproduce issues with PowerMedia XMS. Earlier versions of Client Library included samples for the RESTful API interface and the newest version also supports MSML. In order to build these MSML payloads, the Client Library uses Dialogic's MSML schema. This MSML schema needs to be converted to JAXB classes that can be used in the Java based library.
Client Library can be obtained from the Dialogic GitHub repository . Once at this site, use the "Download ZIP" button to download the project from the master branch.
Follow the Getting Started with XMS REST using Client Library article to set up the project in your IDE. After setting up the project, you will notice compilation errors for the MSML portion of the code. These errors are on the imports as the JAXB classes are missing in your workspace. In order to generate these classes follow the steps below:
1. After building the project, you will notice import errors in Msml related classes as shown in the image below
2. To resolve this, use the xsd file(msml.xsd) provided as part of the project to generate the required classes.
a. The xsd file can be found under XMSClientLibrary/xml-resources/jaxb/XMSMsml/
b. Right click on the java project -> New -> JAXB Binding
c. Fill in the details to create the JAXB Binding.
Binding Name -> Unique name
Select From Local System -> Browse through the project to get the file from XMSClientLibrary/xml-resources/jaxb/XMSMsml/
Package Name -> Set this as com.dialogic.xms.msml since this is the package name used in the classes
d. The above will create a folder under the project, containing the generated files from xsd.
1. Navigate to the location of the xsd file in Project Explorer. Right click on the schema (.xsd file) and select Generate -> JAXB Classes
2. Select the java project, in this case XMSClientLibrary, click Next
3. Fill in the package name and click Finish
4. The above will create classes using xsd with com.dialogic.xms.msml as package name.
5. Right click on XMSClientLibrary in Project Explorer and "Build Project".
See also:Getting Started with XMS REST Application Development using Sample XMS Java Client Library
XMSEchoTest - XMS Java Client Library Sample - for REST Application Development
First published: 19-May-2016
Open access: Product rule: open; Page rule: Auto