|
Hello, I have written an Axis web service, which I have
successfully invoked with an Axis client. I’m now trying to write an
equivalent client using standard SOAP. The relevant code in the SOAP client
looks something like: cl.setTargetObjectURI("urn:dohello");
cl.setMethodName("sayHello");
cl.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
Vector params = new Vector();
params.addElement(new Parameter("name", String.class, name, null));
params.addElement(new Parameter("age", Integer.class, a, null));
cl.setParams(params); When I then try to invoke the call using the command: response =
cl.invoke(ept, ""); Where ‘ept’ is the URL of my service. I’m
expecting a string back (nothing complex), but I get an exception that tells me
it can’t find a deserializer: [SOAPException:
faultCode=SOAP-ENV:Client; msg=No Deserializer found to deserialize a
'http://schemas.xmlsoap.org/soap/encoding/:string' using
encoding style 'http://schemas.xmlsoap.org/soap/encoding/'.;
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’ve tried messing around with SOAPMappingRegistry,
but it seems to make no difference at all, I added the lines: SOAPMappingRegistry
smr = new SOAPMappingRegistry(); StringDeserializer
sd = new StringDeserializer(); smr.mapTypes(Constants.NS_URI_SOAP_ENC,
new QName("", "sayHelloReturn"), null, null, sd); cl.setSOAPMappingRegistry(smr); But it made no difference. I know I’m getting a
valid response from my Web Service, the xml that comes back from the call looks
like: <?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:sayHelloResponse
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns1="urn:dohello"> <sayHelloReturn
xsi:type="soapenc:string"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
Hello Ben, aged 26 </sayHelloReturn> </ns1:sayHelloResponse> </soapenv:Body> </soapenv:Envelope> It just seems that my client can’t unwrap it
properly to give me the result. I can’t find anywhere that seems to provide me
with enough detail to identify the root of my problem. Can anyone help? Ben P.S. Are there any plans to put functionality into
Axis so that complex types can be easily passed around to other platforms? (I
know there’s some bean stuff, but what about collections etc.?) =========================================================================== |
- Re: Calling an Axis Web Service with a SOAP client Ben Abramson
- Re: Calling an Axis Web Service with a SOAP client Scott Nichol
- RE: Calling an Axis Web Service with a SOAP client Ben Abramson
- Re: Calling an Axis Web Service with a SOAP client Scott Nichol
