0

I have a java archive, schema.jar, containing classes generated from an XSD using xjc. I need to create a CXF web service (jax-ws) with web methods that create and return objects from the set of generated classes in schema.jar. I have tried with CXF using a code-first approach, but, although the generated WSDL is valid, the SOAP responses are not valid because of namespace issues on the types imported from schema.jar

EDIT: The response has two declaration of the same namespace from the XSD using different prefixes (ns2 and ns3). Parts of the returned objects rendered have elements from ns2, while other elements use ns3. Validating the response with XMLSpy lists elements as being out of place because of this weird behavior.

I've been searching for documents, tutorial, bogs, or anything that might help but not finding much in the way of useful information. Assuming this can be done, are there any special steps to follow when doing something like this?

Matt
  • 526
  • 6
  • 19

1 Answers1

0

I think I've resolved the issue by placing a @WebResult(targetNamespace="...") annotation on each of the interface methods to make sure the returned objects get rendered using the same namespace.

Regards, Matt

Matt
  • 526
  • 6
  • 19