wsdl soap analyzer namespace issue
Posted: Mon Jul 10, 2006 11:45 pm
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.
-------------------
<?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.