wsdl soap analyzer namespace issue

Having trouble installing Oxygen? Got a bug to report? Post it all here.
farmer
Posts: 1
Joined: Mon Jul 10, 2006 11:31 pm

wsdl soap analyzer namespace issue

Post by farmer »

I'm having trouble with complex types in wsdl. Given this wsdl:

-------------------

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions
targetNamespace="http://xml.com/ws/UserService/2005/04/04"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:impl="http://xml.com/ws/UserService/2005/04/04"
xmlns:tns1="urn:UserService"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:soapbind="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">


<wsdl:types>
<schema targetNamespace="urn:UserService" xmlns="http://www.w3.org/2001/XMLSchema">
<complexType name="ctype">
<sequence>
<element name="listelem" minOccurs="0" maxOccurs="unbounded"></element>
</sequence>
</complexType>
</schema>

<schema targetNamespace="http://xml.com/ws/UserService/2005/04/04" xmlns="http://www.w3.org/2001/XMLSchema">
<element name="MsgFormat" type="tns1:ctype" />
</schema>
</wsdl:types>


<wsdl:message name="Response">
<wsdl:part name="AuthenticateUserReturn" element="impl:MsgFormat" />
</wsdl:message>
<wsdl:message name="Request">
<wsdl:part name="echoStr" element="impl:MsgFormat" />
</wsdl:message>

<wsdl:portType name="UserStore">
<wsdl:operation name="initialize" >
<wsdl:input message="impl:Request" name="Request" />
<wsdl:output message="impl:Response" name="Response" />
</wsdl:operation>
</wsdl:portType>

<wsdl:binding name="UserServiceSoapBinding" type="impl:UserStore">
<soapbind:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="initialize">
<soapbind:operation soapAction="" />
<wsdl:input name="Request">
<soapbind:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="literal" />
</wsdl:input>
<wsdl:output name="Response">
<soapbind:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>

<wsdl:service name="UserStoreService">
<wsdl:port binding="impl:UserServiceSoapBinding" name="UserService">
<soapbind:address location="http://haha.com/axis/services/UserService" />
</wsdl:port>
</wsdl:service>

</wsdl:definitions>

-----------------------

I get this in the analyzer. Note that it doesn't get down the to the "listelem" level...


<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header/>
<SOAP-ENV:Body>
<MsgFormat xmlns="http://xml.com/ws/UserService/2005/04/04"/>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>


-------------------------

If I change the types element to put the ctype definition in the same namespace as the MsgFormat element like so:

-------------------------

<wsdl:types>
<schema targetNamespace="http://xml.com/ws/UserService/2005/04/04" xmlns="http://www.w3.org/2001/XMLSchema">
<element name="MsgFormat" type="impl:ctype" />
<complexType name="ctype">
<sequence>
<element name="listelem" minOccurs="0" maxOccurs="unbounded"></element>
</sequence>
</complexType>
</schema>
</wsdl:types>


----------------------------------

then it finds it, but puts it in a namespace xmlns=""...


---------------------------------

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header/>
<SOAP-ENV:Body>
<MsgFormat xmlns="http://xml.com/ws/UserService/2005/04/04">
<listelem xmlns=""/>
</MsgFormat>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

------------------------------

Niether of these works for me. In the first case, listelem seems to be not found, in the second case it's in the wrong namespace.
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Post by Radu »

Hi,

About the first problem, having 2 schemas in the <wsdl:types> and refering from an element in the first one to a complex type in the other, there seems to be a problem in how Oxygen handles the situation and I'll place a bug report. We'll keep you up to date with the progress.

About the second issue, having a single schema with both the complex type and the element, it is correct adding a "xmlns=''" to the "listelem" element because it is locally declared and locally declared elements, unless not specified, are from no namespace.
The workaround is to add the "form="qualified"" attribute to the local element declaration as follows (in this way the element gets mapped in the target namespace):

Code: Select all

        <schema targetNamespace="http://xml.com/ws/UserService/2005/04/04" 
xmlns="http://www.w3.org/2001/XMLSchema" xmlns:a="http://xml.com/ws/UserService/2005/04/04">
<element name="MsgFormat" type="a:ctype" />
<complexType name="ctype">
<sequence>
<element name="listelem" form="qualified" minOccurs="0" maxOccurs="unbounded"></element>
</sequence>
</complexType>
</schema>
So as a workaround you can merge the two schemas into one.

Best regards,
Radu.
Post Reply