Oxygen Editor and WSDL analyzer

Questions about XML that are not covered by the other forums should go here.
geezenslaw
Posts: 1
Joined: Wed Nov 23, 2011 6:33 pm

Oxygen Editor and WSDL analyzer

Post by geezenslaw » Wed Nov 23, 2011 10:48 pm

Hello Oxygen, I have a curious situation with a public WSDL.

The target WSDL has been generated by a .NET WS.

The WSDL has a property attribute 'any' already defined in the same node.

Therefore when I try to run wsdl2java or wsimport to generate the Java stubs for my SOAP client I get the following error condition returned:

********************************************************
WSDLToJava Error: Thrown by JAXB:
Thrown by JAXB:
Property "Any" is already defined. Use <jaxb:property> to resolve this conflict.
at line 48 column 19 of schema http://ts2.nbs-us.com/TestWS/Service.asmx?WSDL
********************************************************

When I run the same WSDL in the WSDL Analyzer the correct SOAP request and response envelopes are generated.

The question is then: what does the WSDL analyzer do to clean the target WSDL to avoid the error?

Can what the Oxygen Editor WSDL analyzer be applied using a xsd binding?

Radu
Posts: 7311
Joined: Fri Jul 09, 2004 5:18 pm

Re: Oxygen Editor and WSDL analyzer

Post by Radu » Thu Nov 24, 2011 12:16 pm

Hi,

So your WSDL contains in the embedded XML Schema at some point the following construct:

Code: Select all

<s:element minOccurs="0" maxOccurs="1" name="GetDataTableResult">
<s:complexType>
<s:sequence>
<s:any minOccurs="0" maxOccurs="unbounded"
namespace="http://www.w3.org/2001/XMLSchema" processContents="lax"/>
<s:any minOccurs="1"
namespace="urn:schemas-microsoft-com:xml-diffgram-v1"
processContents="lax"/>
</s:sequence>
</s:complexType>
</s:element>
Oxygen uses the Xerces parser to validate and construct SOAP messages from the embedded XML Schema types.
So for an XML validator which fully complies with the XML Schema specification there does not seem to be any problem with the embedded schema.

But WSDL2Java uses from what it seems an engine JAXB which has issues with certain constructs in the XML Schema.
if you google for the exact error message you will find some advice about how to configure JAXB to avoid this problem.
Another idea is for you to manually modify the schema and remove one of the <any> constructs, depending on whether it is necessary or not, of course.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

Post Reply