• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JAXB bindings

 
Ranch Hand
Posts: 68
Netbeans IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Netbeans IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
Evacuate the building! Here, take this tiny ad with you:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic