You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Oliver Hirschi <oh...@pm-medici.ch> on 2005/09/14 07:45:47 UTC

Read SOAP-Response-Value

Hi,

I am really confused. I try to call a soap-method on a server with one
parameter and I like to get the return-parameter of this method, but I
get ever the following exception by invoking the call:
--------------------------------------
No Deserializer found to deserialize a
&apos;http://schemas.xmlsoap.org/soap/encoding/:string&apos; using
encoding style &apos;http://schemas.xmlsoap.org/soap/encoding/&apos;.

[SOAPException: faultCode=SOAP-ENV:Client; msg=No Deserializer found to
deserialize a
&apos;http://schemas.xmlsoap.org/soap/encoding/:string&apos; using
encoding style &apos;http://schemas.xmlsoap.org/soap/encoding/&apos;.;
targetException=java.lang.IllegalArgumentException: No Deserializer
found to deserialize a
'http://schemas.xmlsoap.org/soap/encoding/:string' using encoding style
'http://schemas.xmlsoap.org/soap/encoding/'.]
--------------------------------------

I think the call on the server is correct:
--------------------------------------
<?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/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<SOAP-ENV:Body>
<ns1:HelloTEST xmlns:ns1="http://impl.webservice._Test.com"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<HelloName xsi:type="ns1:HelloTESTReturn">This is Oliver!</HelloName>
</ns1:HelloTEST>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
--------------------------------------

I think also the answer from the server is correct:
--------------------------------------
<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<ns1:HelloTESTResponse
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns1="http://impl.webservice._Test.com">
<HelloTESTReturn xsi:type="soapenc:string"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">Hello from
Server: This is Oliver!</HelloTESTReturn>
</ns1:HelloTESTResponse>
</soapenv:Body>
</soapenv:Envelope>

My code is like:
--------------------------------------
...
Vector vSOAPParams = new Vector();
vSOAPParams.addElement(new Parameter("HelloName", String.class, "This is
Oliver!", Constants.NS_URI_SOAP_ENC));
oCall.setParams(vSOAPParams);
// ReturnValue
SOAPMappingRegistry smr = new SOAPMappingRegistry();
Deserializer sd = new StringDeserializer();
smr.mapTypes(Constants.NS_URI_SOAP_ENC, new
QName("http://impl.webservice._Test.com", "HelloTESTReturn"),
String.class, null, sd);
oCall.setSOAPMappingRegistry(smr);

Response resp = oCall.invoke(oURL,
"http://impl.webservice._Test.com/HelloTEST"); // throws SOAPException
...
--------------------------------------

I don't know, why I don't get the return-value "Hello from Server: This
is Oliver!".
There is ever a SOAPException catched by "Response resp =
oCall.invoke(...);"

Could anybody help me!

Thanks a lot.
-- 
Oliver Hirschi
http://www.FamilyHirschi.ch