Hi,

I have a problem with a test service I created using Apache SOAP. I am
receiving the following encoding error when trying to invoke my test method
from the http://www.soapclient.com/soaptest.html website:

<?xml version='1.0' encoding='UTF-8'?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/";
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance";
xmlns:xsd="http://www.w3.org/1999/XMLSchema";>
<SOAP-ENV:Body>
<SOAP-ENV:Fault>
<faultcode>SOAP-ENV:Client</faultcode>
<faultstring>No Deserializer found to deserialize a
'http://schemas.xmlsoap.org/soap/encoding/:string' using encoding style
'http://schemas.xmlsoap.org/soap/encoding/'.</faultstring>
<faultactor>/soap/servlet/rpcrouter</faultactor>
</SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Clearly the wrong encoding is used by that site as the request they issue
shows:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/";
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/";
xmlns:impl="http://*mysite*/tams.wsdl-impl";
xmlns:intf="http://*mysite*/tams.wsdl";
xmlns:tns2="http://xml.apache.org/xml-soap";
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/";
xmlns:xsd="http://www.w3.org/2001/XMLSchema";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/";>
<SOAP-ENV:Body>
<mns:addTerm xmlns:mns="http://*mysite*/tams.wsdl";>
<term xsi:type="SOAP-ENC:string">testing</term>
</mns:addTerm>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

The WSDL has this in it, i.e. I specified the function to use the
http://www.w3.org/1999/XMLSchema encoding, but the above server always
encodes it with the wrong http://schemas.xmlsoap.org/soap/encoding/
encoding:

<?xml version="1.0" encoding="UTF-8"?>
<definitions name="TAMS" targetNamespace="http://*mysite*/tams.wsdl";
xmlns="http://schemas.xmlsoap.org/wsdl/";
xmlns:xsd="http://www.w3.org/1999/XMLSchema";
xmlns:intf="http://*mysite*/tams.wsdl";
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/";>
   <message name="addTermRequest">
      <part name="term" type="xsd:string"/>
   </message>
   <message name="addTermResponse">
      <part name="return" type="xsd:boolean"/>
   </message>
   <portType name="TAMSApi">
      <operation name="addTerm">
         <input message="intf:addTermRequest" name="addTerm"/>
         <output message="intf:addTermResponse" name="addTermResponse"/>
      </operation>
   </portType>
   <binding name="rpcrouterSoapBinding" type="intf:TAMSApi">
      <soap:binding style="rpc"
transport="http://schemas.xmlsoap.org/soap/http"/>
      <operation name="addTerm">
         <soap:operation soapAction=""/>
         <input name="addTerm">
            <soap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/";
namespace="http://*mysite*/tams.wsdl"; use="encoded"/>
         </input>
         <output name="addTermResponse">
            <soap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/";
namespace="http://*mysite*/tams.wsdl"; use="encoded"/>
         </output>
      </operation>
   </binding>
   <service name="TAMSApiService">
      <documentation>TAMS Service</documentation>
      <port binding="intf:rpcrouterSoapBinding" name="rpcrouter">
         <soap:address location="http://*mysite*/soap/servlet/rpcrouter"/>
      </port>
   </service>
</definitions>

Can anybody please help me to clarify as to why the soapclient testpage
always uses the wrong encoding for my service? I have to note that when you
do the same thing for the WSDL that is already filled in on the form when
you open it everything does work fine and they use the correct encoding. I
compared that WSDL with mine but I cannot see any difference that could
cause this problem.

Help!

Kind regards,
Lars



Reply via email to