This is a question that was posted on StackOverflow, that nobody has answered yet.
I hope nobody minds me repeating the question here at the saloon:
I'm using the Metro stack bundled with Java 6 SE to call a web service. The web service expects XML as a parameter. I use JAXB classes to create content and pass my JAXB root element to the web service endpoint.
Now to my Problem: I can't find any way to make the marshaller include the schemaLocation of the XSD file since I can't directly access the marshaller. (If you have direct access to the marshaller it is possible do set the schemalocation as a property, but when using metro, all the marshalling seems to be happening internally.)
I've tried setting the xsi:schemaLocation in the XmlSchema annotation in the generated package-info.java class, but this had no effect on the xml generated.
Does anyone have any ideas how to solve this problem?
You can set this property on the Marshaller for including the namespace in generated XML.
scjp 1.5, OCPJWSD 5
Joined: Apr 14, 2009
Thank you for your reply, but I already know hat. If you read my posting carefully, you will See hat your suggestion is not an option. I dont have access to the marshaller as I am passing my jaxb object directly to the webservice end point. My Guess is that Metro uses the marshaller internally.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
subject: schemaLocation ignored when marshalling JAXB Classes using Metro