I want to add a super interface for a class autogenerated by jaxb and xsdtojava.
Problem: I can only add the interface on the root element (which I don't want, but just for testing purpose).
The element where I want to apply the inheritance is thelistelement.
The xsd I have not control of.
<xs:schema>
<xs:element name="myRequest">
<xs:complexType>
<xs:sequence>
<xs:element name="thelist">
<xs:complexType>
<xs:sequence>
<xs:element name="thelistelement" maxOccurs="unbounded">
...
binding file:
<jaxb:bindings
xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
xmlns:inheritance="http://jaxb2-commons.dev.java.net/basic/inheritance"
jaxb:extensionBindingPrefixes="xjc inheritance"
jaxb:version="2.1">
<!-- this works -->
<jaxb:bindings schemaLocation="xsd/my.xsd">
<jaxb:bindings node="//xs:element[#name='myRequest']">
<inheritance:implements>MyInterface</inheritance:implements>
</jaxb:bindings>
</jaxb:bindings>
<!-- this does NOT work -->
<jaxb:bindings schemaLocation="xsd/my.xsd">
<jaxb:bindings node="//xs:element[#name='thelistelement']">
<inheritance:implements>MyInterface</inheritance:implements>
</jaxb:bindings>
</jaxb:bindings>
</jaxb:bindings>
Running with <extensionArg>-Xinheritance</extensionArg>.
Output should be:
...
List<Thelistelement> thelist;
class Thelistelement implements MyInterface {
}
But the interface is missing on the list element class. Why then does it work on the root element myRequest?
I had to add an /xs:complexType to the node. Don't know why that worked though.
Important to note the single slash before the complexType!
<jaxb:bindings schemaLocation="xsd/my.xsd">
<jaxb:bindings node="//xs:element[#name='thelistelement']/xs:complexType">
<inheritance:implements>MyInterface</inheritance:implements>
</jaxb:bindings>
</jaxb:bindings>
Related
I want to generate a set of JAXB annotated classes of the OGC IndoorGML XML scheme (http://schemas.opengis.net/indoorgml/1.0/indoorgmlcore.xsd)
So I run xjc -d scr -p [packagename] -nv [path_to_xsd] (the -nv suppresses the strict validation of input schemes)
But running this command results in the following error messages:
[ERROR] Property "Rows" is already defined. Use <jaxb:property> to resolve this conflict.
line 653 of http://schemas.opengis.net/gml/3.2.1/geometryPrimitives.xsd
[ERROR] The following location is relevant to the above error
line 685 of http://schemas.opengis.net/gml/3.2.1/geometryPrimitives.xsd
[ERROR] Property "Title" is already defined. Use <jaxb:property> to resolve this conflict.
line 261 of http://www.w3.org/1999/xlink.xsd
[ERROR] The following location is relevant to the above error
line 246 of http://www.w3.org/1999/xlink.xsd
[ERROR] Property "Title" is already defined. Use <jaxb:property> to resolve this conflict.
line 232 of http://www.w3.org/1999/xlink.xsd
[ERROR] The following location is relevant to the above error
line 219 of http://www.w3.org/1999/xlink.xsd
and the class files are not being generated. This is strange, because I would expect these "official" schemes to be correct.
However, is there still any way to generate the java classes ignoring these errors?
After some trial and error and based on this xjb binding file, this command line will generate code
xjc -d src -XautoNameResolution -b indoor.xjb -nv indoorgmlcore.xsd
No package name is used, -XautoNameResolution is added and some extensions were removed. Comments inxjb file denote changes added to the original xjb. Latest version of xsd was used.
indoor.xjb contents:
<jaxb:bindings version="1.0" xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
jaxb:extensionBindingPrefixes="xjc">
<!--
xmlns:wildcard="http://jaxb2-commons.dev.java.net/basic/wildcard"
xmlns:annox="http://annox.dev.java.net"
-->
<jaxb:bindings schemaLocation="http://schemas.opengis.net/gml/3.2.1/gml.xsd"
node="/xs:schema">
<jaxb:schemaBindings>
<jaxb:package name="net.opengis.gml.v_3_2"/>
</jaxb:schemaBindings>
</jaxb:bindings>
<jaxb:bindings schemaLocation="http://schemas.opengis.net/gml/3.2.1/geometryPrimitives.xsd" node="/xs:schema">
<jaxb:bindings>
<jaxb:bindings node="//xs:group[#name='PointGrid']/xs:sequence/xs:element[#name='rows']">
<!-- ** Backwards incompatible -->
<jaxb:property name="PointGridRows"/>
</jaxb:bindings>
</jaxb:bindings>
</jaxb:bindings>
<!-- StackOverflow 68692723 question -->
<jaxb:bindings schemaLocation="http://www.w3.org/1999/xlink.xsd" node="/xs:schema">
<jaxb:bindings>
<jaxb:bindings node="//xs:element[#name='title']">
<jaxb:property name="XTitle"/>
</jaxb:bindings>
</jaxb:bindings>
</jaxb:bindings>
<jaxb:bindings schemaLocation="http://schemas.opengis.net/gml/3.2.1/coordinateOperations.xsd">
<jaxb:bindings node="//xs:element[#name='parameterValue']">
<jaxb:factoryMethod name="xparameterValue"/>
</jaxb:bindings>
<jaxb:bindings node="//xs:element[#name='operationParameter']">
<jaxb:factoryMethod name="xoperationParameter"/>
</jaxb:bindings>
<jaxb:bindings node="//xs:element[#name='OperationParameter']">
<jaxb:factoryMethod name="XOperationParameter"/>
</jaxb:bindings>
</jaxb:bindings>
<!-- StackOverflow 68692723 question END -->
<jaxb:bindings schemaLocation="http://schemas.opengis.net/gml/3.2.1/grids.xsd" node="/xs:schema">
<jaxb:bindings>
<jaxb:bindings node="xs:complexType[#name='GridType']/xs:complexContent/xs:extension/xs:sequence/xs:choice/xs:element[#name='axisLabels']">
<!-- ** Backwards incompatible -->
<jaxb:property name="GridAxisLabels"/>
</jaxb:bindings>
</jaxb:bindings>
</jaxb:bindings>
<jaxb:bindings schemaLocation="http://schemas.opengis.net/gml/3.2.1/datums.xsd" node="/xs:schema">
<jaxb:bindings>
<jaxb:bindings node="//xs:element[#name='secondDefiningParameter']">
<jaxb:class name="SecondDefiningParameterPropertyElement"/>
</jaxb:bindings>
<jaxb:bindings node="//xs:element[#name='ellipsoid']">
<jaxb:factoryMethod name="EllipsoidPropertyElement"/>
</jaxb:bindings>
<jaxb:bindings node="//xs:element[#name='primeMeridian']">
<jaxb:factoryMethod name="PrimeMeridianPropertyElement"/>
</jaxb:bindings>
</jaxb:bindings>
</jaxb:bindings>
<jaxb:bindings schemaLocation="http://schemas.opengis.net/gml/3.2.1/coordinateReferenceSystems.xsd" node="/xs:schema">
<jaxb:bindings>
<jaxb:bindings node="//xs:element[#name='userDefinedCS']">
<jaxb:factoryMethod name="UserDefinedCSPropertyElement"/>
</jaxb:bindings>
<jaxb:bindings node="//xs:element[#name='cartesianCS']">
<jaxb:factoryMethod name="CartesianCSPropertyElement"/>
</jaxb:bindings>
<jaxb:bindings node="//xs:element[#name='sphericalCS']">
<jaxb:factoryMethod name="SphericalCSPropertyElement"/>
</jaxb:bindings>
<jaxb:bindings node="//xs:element[#name='polarCS']">
<jaxb:factoryMethod name="PolarCSPropertyElement"/>
</jaxb:bindings>
<jaxb:bindings node="//xs:element[#name='linearCS']">
<jaxb:factoryMethod name="LinearCSPropertyElement"/>
</jaxb:bindings>
<jaxb:bindings node="//xs:element[#name='verticalCS']">
<jaxb:factoryMethod name="VerticalCSPropertyElement"/>
</jaxb:bindings>
<jaxb:bindings node="//xs:element[#name='cylindricalCS']">
<jaxb:factoryMethod name="CylindricalCSPropertyElement"/>
</jaxb:bindings>
<jaxb:bindings node="//xs:element[#name='ellipsoidalCS']">
<jaxb:factoryMethod name="EllipsoidalCSPropertyElement"/>
</jaxb:bindings>
<jaxb:bindings node="//xs:element[#name='affineCS']">
<jaxb:factoryMethod name="AffineCSPropertyElement"/>
</jaxb:bindings>
<jaxb:bindings node="//xs:element[#name='timeCS']">
<jaxb:factoryMethod name="TimeCSPropertyElement"/>
</jaxb:bindings>
<jaxb:bindings node="//xs:element[#name='imageDatum']">
<jaxb:factoryMethod name="ImageDatumPropertyElement"/>
</jaxb:bindings>
<jaxb:bindings node="//xs:element[#name='geodeticDatum']">
<jaxb:factoryMethod name="GeodeticDatumPropertyElement"/>
</jaxb:bindings>
<jaxb:bindings node="//xs:element[#name='temporalDatum']">
<jaxb:factoryMethod name="TemporalDatumPropertyElement"/>
</jaxb:bindings>
<jaxb:bindings node="//xs:element[#name='engineeringDatum']">
<jaxb:factoryMethod name="EngineeringDatumPropertyElement"/>
</jaxb:bindings>
<jaxb:bindings node="//xs:element[#name='verticalDatum']">
<jaxb:factoryMethod name="VerticalDatumPropertyElement"/>
</jaxb:bindings>
<jaxb:bindings node="//xs:element[#name='conversion']">
<jaxb:factoryMethod name="ConversionPropertyElement"/>
</jaxb:bindings>
</jaxb:bindings>
</jaxb:bindings>
</jaxb:bindings>
Errors as below where fixed based on this page
[ERROR] Two declarations cause a collision in the ObjectFactory class.
line 243 of http://schemas.opengis.net/gml/3.2.1/coordinateOperations.xsd
My wsdl specification contains imported XSD schema.
wsdl file looks like below
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" ....>
<wsdl:types>
<xsd:schema targetNamespace="http://tempuri.org/Imports">
<xsd:import schemaLocation="https://abcserver.com/v2/two-way-ssl/MyService.svc?xsd=xsd2" namespace="http://tempuri.org/"/>
<xsd:import schemaLocation="https://abcserver.com/v2/two-way-ssl/MyService.svcc?xsd=xsd4" namespace="http://schemas.datacontract.org/2004/07/System.Web.Services.Protocols"/>
<xsd:import schemaLocation="https://abcserver.com/v2/two-way-ssl/MyService.svc?xsd=xsd0" namespace="http://schemas.microsoft.com/2003/10/Serialization/"/>
<xsd:import schemaLocation="https://abcserver.com/v2/two-way-ssl/MyService.svc?xsd=xsd1" namespace="http://schemas.datacontract.org/2004/07/ABCUser.Web.Services"/>
<xsd:import schemaLocation="https://abcserver.com/v2/two-way-ssl/MyService.svc?xsd=xsd3" namespace="http://schemas.datacontract.org/2004/07/ABCUser.Web.ServiceModels"/>
<xsd:import schemaLocation="https://abcserver.com/v2/two-way-ssl/MyService.svc?xsd=xsd5" namespace="http://schemas.datacontract.org/2004/07/System"/>
<xsd:import schemaLocation="https://abcserver.com/v2/two-way-ssl/MyService.svc?xsd=xsd6" namespace="http://schemas.microsoft.com/2003/10/Serialization/Arrays"/>
<xsd:import schemaLocation="https://abcserver.com/v2/two-way-ssl/MyService.svc?xsd=xsd7" namespace="http://schemas.datacontract.org/2004/07/System.Collections.Generic"/>
<xsd:import schemaLocation="https://abcserver.com/v2/two-way-ssl/MyService.svc?xsd=xsd8" namespace="http://schemas.datacontract.org/2004/07/ABC.Fs.UIEntities"/>
<xsd:import schemaLocation="https://abcserver.com/v2/two-way-ssl/MyService.svc?xsd=xsd9"/>
</xsd:schema>
</wsdl:types>
.......
</wsdl:definitions>
My jaxb bindings file look like below:
<jaxws:bindings xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:jaxws="http://java.sun.com/xml/ns/jaxws"
xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" jaxb:version="2.1"
wsdlLocation="https://abcserver.com/v2/two-way-ssl/MyService.svc?wsdl">
<enableWrapperStyle>true</enableWrapperStyle>
<enableAsyncMapping>false</enableAsyncMapping>
<jaxws:bindings node="wsdl:definitions/wsdl:types/xs:schema/xs:complexType[#name='Node']/xs:sequence/xs:element[#name='Type']">
<jaxb:class name="NodeTypeString"/>
</jaxws:bindings>
</jaxws:bindings>
If I don't use bindings.xml, I get following error while generating java classes through wsimport
[ERROR] Two declarations cause a collision in the ObjectFactory class.
line 1 of https://abcserver.com/v2/two-way-ssl/MyService.svc?xsd=xsd3
[ERROR] (Related to above error) This is the other declaration.
line 1 of https://abcserver.com/v2/two-way-ssl/MyService.svc?xsd=xsd3
Schema it is complaining about looks like below
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://schemas.datacontract.org/2004/07/ABCUser.Web.ServiceModels" elementFormDefault="qualified" targetNamespace="http://schemas.datacontract.org/2004/07/ABCUser.Web.ServiceModels">
<xs:import schemaLocation="https://abcserver.com/v2/two-way-ssl/MyService.svc?xsd=xsd6" namespace="http://schemas.microsoft.com/2003/10/Serialization/Arrays"/>
.......
<xs:complexType name="Node">
<xs:sequence>
<xs:element minOccurs="0" name="Description" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="Name" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="Type" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="Users" nillable="true" type="tns:ArrayOfUser"/>
</xs:sequence>
</xs:complexType>
<xs:element name="Node" nillable="true" type="tns:Node"/>
......
But now when I use bindings.xml, I get the following error
[ERROR] XPath evaluation of "wsdl:definitions/wsdl:types/xs:schema/xs:complexType[#name='Node']/xs:sequence/xs:element[#name='Type']" results in an empty target node
line 8 of file:/E:/projects/codegeneration/bindings.xml
What am I missing? I am using wsimport to generate the classes.
<xsd:import> does not actually change the WSDL file’s XML document tree. You have elements matching wsdl:definitions/wsdl:types/xs:schema/xs:import, not wsdl:definitions/wsdl:types/xs:schema/xs:complexType/xs:sequence/xs:element.
The JAX-WS specification’s “Customizations” chapter says:
Additionally, jaxb:bindings MAY appear inside a JAX-WS external binding file as a child of a jaxws:bindings element whose node attribute points to a xs:schema element inside a WSDL document. When the schema is processed, the outcome MUST be as if the jaxb:bindings element was inlined inside the schema document as an annotation on the schema component.
While processing a JAXB binding declaration (i.e. a jaxb:bindings element) for a schema document embedded inside a WSDL document, all XPath expressions that appear inside it MUST be interpreted as if the containing xs:schema element was the root of a standalone schema document.
So, your inner jaxws:bindings element must contain the XPath of the xs:schema element, not any of its descendants:
<jaxws:bindings node="wsdl:definitions/wsdl:types/xs:schema">
<jaxb:bindings node="xs:complexType[#name='Node']/xs:sequence/xs:element[#name='Type']">
<jaxb:class name="NodeTypeString"/>
</jaxb:bindings>
</jaxws:bindings>
I’m not sure if the above will actually work with a schema that uses <xsd:import>. You may have to refer to the imported schema explicitly:
<jaxws:bindings node="wsdl:definitions/wsdl:types/xs:schema">
<jaxb:bindings schemaLocation="https://abcserver.com/v2/two-way-ssl/MyService.svc?xsd=xsd2">
<jaxb:bindings node="xs:complexType[#name='Node']/xs:sequence/xs:element[#name='Type']">
<jaxb:class name="NodeTypeString"/>
</jaxb:bindings>
</jaxb:bindings>
</jaxws:bindings>
I got two solutions for this issue I was facing.
I streamlined the wsdl schema by adding imported schema in it and removing import statements.
First build an episode using xjc for imported schema
xjc -episode myschema.episode myschema.xsd
And then use that episode as a binding in java classes generation through wsimport
wsimport mywsdl.wsdl -b myschema.episode
More about 2nd solution here
I'm generating java classes from xsd with cxf-xjc-plugin.
<?xml version="1.0" encoding="utf-16"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="result">
...
</xsd>
I'm trying to rename the root element using a jaxb-binding.xml file:
<jaxb:bindings
xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
jaxb:extensionBindingPrefixes="xjc"
jaxb:version="2.1">
<jaxb:bindings schemaLocation="xsd/myxsd.xsd" node="//xsd:element[#name='result']">
<jaxb:class name="MyNewName" />
</jaxb:bindings>
</jaxb:bindings>
But it does not work. The generated java class is named Result. What might be wrong here?
I am using JAXB 2.0. I have various elements and types defined in an XSD file. Here's an example:
<xs:element name="Person" type="Person" />
<xs:complexType name="Person">
<xs:attribute name="name" type="xs:string"/>
</xs:complexType>
<xs:element name="Musician" type="Musician"/>
<xs:complexType name="Musician">
<xs:complexContent>
<xs:extension base="Person">
<xs:attribute name="instrument" type="xs:string"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:element name="People" type="People"/>
<xs:complexType name="People">
<xs:sequence>
<xs:element name="person" type="Person" minOccurs="0" maxOccurs="Unbounded/>
</xs:sequence>
</xs:complexType>
So as you can see from the above schema example, we have a Person, who has a name, and a Musician, who is also a Person (though this may be subject to some debate, but that's for another forum). There is also a People element, which is essentially a collection of Person types.
I have the following in a bindings file:
<?xml version="1.0" encoding="UTF-8"?>
<jaxb:bindings xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
jaxb:version="2.0"
xmlns:xjc= "http://java.sun.com/xml/ns/jaxb/xjc"
jaxb:extensionBindingPrefixes="xjc">
<jaxb:globalBindings optionalProperty="wrapper">
<xjc:simple/>
</jaxb:globalBindings>
My intended use of these objects is:
A Person may appear as a solitary Marshalled element, or may be a part of a People object
If a Person is part of a People object, then the xsi:type should indicate whether it's just a normal Person or a Musician.
So I need the generated Java classes to contain both an #XmlRootElement annotation as well as an #XmlType annotation. The xjc:simple binding creates both annotations for a Musician, but only creates the #XmlType for Person. So when I Marshall a Person object, all I get is:
<?xml version="1.0" encoding="UTF-8"?>
Whereas what I would like to see is:
<?xml version="1.0" encoding="UTF-8"?>
<Person name="John Doe"/>
For a People object, I want to see:
<?xml version="1.0" encoding="UTF-8"?>
<People>
<person name="John Doe" xsi:type="Person"/>
<person name="Keith Richards" xsi:type="Musician"/>
</People>
I have read about the simple binding with xjc, and it works with all the lowest levels in an inheritance hierarchy. However, the base classes end up without an #XmlRootElement annotation. For the use case I'm working on, it's imperative that base classes can be Marshalled as both a top-level element and as a member of other elements. Any suggestions would be welcome.
https://github.com/highsource/jaxb2-annotate-plugin could be used
<?xml version="1.0" encoding="UTF-8"?>
<jaxb:bindings xmlns:annox="http://annox.dev.java.net"
xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
jaxb:version="2.1"
xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
jaxb:extensionBindingPrefixes="xjc annox">
<jaxb:bindings node="//xs:complexType[#name='Person']">
<annox:annotate>
<annox:annotate annox:class="javax.xml.bind.annotation.XmlRootElement" name="person"/>
</annox:annotate>
</jaxb:bindings>
</jaxb:bindings>
I have a couple of SOAP services (implemented in .Net) that I want to generate a Java stub for. The first service was no problem but the second service threw up the error
WSDLToJava Error:
http://localhost/AMS52/ServiceManagement.svc?xsd=xsd8 [0,0]: Two declarations cause a collision in the ObjectFactory class.
http://localhost/AMS52/ServiceManagement.svc?xsd=xsd11 [0,0]: (Related to above error) This is the other declaration.
Not being too familiar with this stuff I eventually figured out that two imports in the wsdl are stepping on each other toes
<wsdl:types>
<xsd:schema targetNamespace="http://tempuri.org/Imports">
...
<xsd:import schemaLocation="http://localhost/AMS52/ServiceManagement.svc?xsd=xsd8" namespace="http://schemas.datacontract.org/2004/07/Company.Platform.Datatypes.Enums"/>
...
<xsd:import schemaLocation="http://localhost/AMS52/ServiceManagement.svc?xsd=xsd11" namespace="http://schemas.datacontract.org/2004/07/Company.Platform.Datatypes.ServiceManagement"/>
...
The xsd for the first import is of the form
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:tns="http://schemas.datacontract.org/2004/07/Company.Platform.Datatypes.Enums"
elementFormDefault="qualified"
targetNamespace="http://schemas.datacontract.org/2004/07/Company.Platform.Datatypes.Enums">
<xs:simpleType name="DeviceIdiom">
<xs:restriction base="xs:string">
<xs:enumeration value="Auto"/>
<xs:enumeration value="Phone"/>
<xs:enumeration value="Tablet"/>
</xs:restriction>
</xs:simpleType>
<xs:element name="DeviceIdiom" nillable="true" type="tns:DeviceIdiom"/>
<xs:simpleType name="ServiceManagementSORType">
...
More reading and I figured out I had to do something like this
How to resolve collision in the ObjectFactory on wsdl2java?
So my approach has been to try and put a suffix on the end of every simple type (they are all simple types).
So my current command line is
./wsdl2java.bat -impl -server -verbose -autoNameResolution -b bindings.xml ServiceManagement.wsdl
And my binding file is
<jaxb:bindings
xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
jaxb:version="2.1">
<jaxb:bindings schemalocation="http://localhost/AMS52/ServiceManagement.svc?xsd=xsd8" node="/xs:schema">
<jaxb:bindings node="//xs:simpleType">
<jaxb:nameXmlTransform>
<jaxb:typeName suffix="Enums" />
</jaxb:nameXmlTransform>
</jaxb:bindings>
</jaxb:bindings>
</jaxb:bindings>
But now I am stuck on this error
XPath evaluation of "//xs:schema" results in empty target node
I can not figure out how to get past this error. I am starting to think it has something to do with the fact it's a .Net service and I have to reference the xsd like so
http://localhost/AMS52/ServiceManagement.svc?xsd=xsd8
Any help greatly appreciated.
Finally figured it out, I replaced
<jaxb:bindings schemalocation="http://localhost/AMS52/ServiceManagement.svc?xsd=xsd8" node="/xs:schema">
with
<jaxb:bindings schemaLocation="http://localhost/AMS52/ServiceManagement.svc?xsd=xsd8" node="/xs:schema">
Not easy to see is it, but note the capital L in schemaLocation - ouch!
Entire problem eventually fixed by mapping the schema for 'Company.Platform.Datatypes.Enums' to a different package with the binding file
<jaxb:bindings
xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
jaxb:version="2.1">
<jaxb:bindings schemaLocation="http://localhost/AMS52/ServiceManagement.svc?xsd=xsd8">
<jaxb:schemaBindings>
<jaxb:package name="org.tempuri.enums"/>
</jaxb:schemaBindings>
</jaxb:bindings>