Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JAXB bindings

 
Philip Grove
Ranch Hand
Posts: 68
Firefox Browser Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to use a web service where I have no control of the WSDL. Unfortunately the WSDL defines the result elements like this:


I have an external XSD that defines the element in greater detail, and a JAXB binding file that should bind the element from the WSDL to the class generated by compiling the XSD. The binding file looks like this:


The schema defines a different targetNamespace than the WSDL so elements with the same name should be legal.

The JAXB bindings are ignored so there is a probably an error somewhere but I have been unable to find out where. I am hoping that people here can help as the sequence of <any> in the WSDL is beginning to cause problems.
 
Philip Grove
Ranch Hand
Posts: 68
Firefox Browser Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To make information a little more complete here are the complete WSDL:



And the complete XSD:



Any other solutions that will make the elements from the XSD used are completely acceptable as well. I am looking at JAXWS bindings of the wsdl:portType but the documentation, or lack thereof, is just as confusing as it is for JAXB bindings.
 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
Since nothing was said, I assume you want to generate artifacts for a client that is to access the webservice using wsimport.
Have you used the -b flag? The -b flag, after which a JAXB binding file is specified, is available both in wsimport and xjc (the JAXB binding compiler).
Example:
wsimport -b MyJAXBBindingFile.xml MyWSDL.wsdl ...
xjc -b MyJAXBBindingFile.xml MyXMLSchema.xsd

References:
http://java.sun.com/webservices/docs/1.5/tutorial/doc/JAXBUsing4.html
http://linux.die.net/man/1/wsimport-java-1.6.0-openjdk
Best wishes!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic