What is the SOAP client code? If you have some code sample for a document style SOAP call, could you please send it to me?
Requires Free Membership to View
So for example, given an operation named "test" that takes two strings in and returns a string, in RPC/encoded, it would be defined like this:
<wsdl:message name="testRequest"> <wsdl:part name="input1" type="xsd:string"/> <wsdl:part name="input2" type="xsd:string"/> </wsdl:message> <wsdl:message name="testResponse"> <wsdl:part name="output" type="xsd:string"/> </wsdl:message>
For document/literal, you would change it to:
<wsdl:types>
<xsd:schema name="testSchema" targetNamespace="urn:testNS">
<xsd:element name="test" type="tTest"/>
<xsd:complexType name="tTest">
<xsd:sequence>
<xsd:element name="input1" type="xsd:string"/>
<xsd:element name="input2" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="testReturn" type="tTestReturn"/>
<xsd:complexType name="tTestReturn">
<xsd:sequence>
<xsd:element name="output" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
</wsdl:types>
<wsdl:message name="testRequest">
<wsdl:part name="parameters" element="tns:test"/>
</wsdl:message>
<wsdl:message name="testResponse">
<wsdl:part name="parameters" element="tns:testReturn"/>
</wsdl:message>
- In <soap:binding>, change the style attribute to "document".
- In <soap:operation>, changes the style attribute to "document".
- In <soap:body> definitions, change the use attribute to "literal", and remove the namespace attribute and the encodingStyle attribute.
Following the same example, for an RPC/encoded
<wsdl:binding name='testBinding'
type='tns:testInterface'>
<soap:binding
transport='http://schemas.xmlsoap.org/soap/http'
style='rpc'/>
<wsdl:operation name='test'>
<soap:operation
soapAction='urn:test'
style='rpc'/>
<wsdl:input>
<soap:body use='encoded'
encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'
namespace='urn:testNS'/>
</wsdl:input>
<wsdl:output>
<soap:body use='encoded'
encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'
namespace='urn:testNS'/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
For document/literal, you would change it to:
<wsdl:binding name='testBinding'
type='tns:testInterface'>
<soap:binding
transport='http://schemas.xmlsoap.org/soap/http'
style='document'/>
<wsdl:operation name='Test'>
<soap:operation
style='document'
soapAction='urn:Test'/>
<wsdl:input>
<soap:body use='literal'/>
</wsdl:input>
<wsdl:output>
<soap:body use='literal'/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
This was first published in October 2004

Join the conversationComment
Share
Comments
Results
Contribute to the conversation