I use CXF to generate client class to access web service server. The web service are based on WCF (.NET).
When I call wsdl2java, I have the following error :
The id property is already defined. use <jaxb:property> to resolve this conflict. The following location matches the above error : http://*****/WcfDemandService.svc?xsd=xsd2 [0,0]
This error does not appear if I ask xmlbeans databinding (use "db xmlbeans" option).
Is there any way to generate classes with JAXB databinding?
This type of problem often occurs when a type has an attribute and element with the same name.
schema.xsd
xjc schema.xsd
When we try to generate a Java model from this XML schema we get the following error.
binding.xml
A JAXB binding file can be used to customize the classes that are generated. Here we will use it to rename the property that will correspond to the
bar
attribute.xjc -b binding.xml schema.xsd
Now when you generate the Java classes you will get a class like: