Title: Using Apache SOAP 2.2 to consume an AXIS Web Service

Hello,

I have deployed a simple service using Axis.  I have tested consuming it with Axis Call classes and it works fine.

I've been doing some interoperability tests and I can't seem to consume the service using Apache SOAP 2.2.

Here is the response I get from the call:


<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

 <SOAP-ENV:Body>
  <ns1:getLastTradeResponse xmlns:ns1="QuoteService">
   <getLastTradeResult xsi:type="xsd:float">5.07</getLastTradeResult>
  </ns1:getLastTradeResponse>
 </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

And the error I get when using Apache 2.2 is:

Exception in thread "main" [SOAPException: faultCode=SOAP-ENV:Client; msg=No Des
erializer found to deserialize a ':getLastTradeResult' using encoding style 'htt
p://schemas.xmlsoap.org/soap/encoding/'.; targetException=java.lang.IllegalArgum
entException: No Deserializer found to deserialize a ':getLastTradeResult' using
 encoding style 'http://schemas.xmlsoap.org/soap/encoding/'.]
        at org.apache.soap.rpc.Call.invoke(Call.java:244)
        at CallTest.axisQuoteOrig(CallTest.java:34)
        at CallTest.main(CallTest.java:138)

My client code is simple:

          Call call = new Call();
        String encoding = Constants.NS_URI_SOAP_ENC;
        call.setEncodingStyleURI(encoding);
       
        call.setTargetObjectURI("QuoteService");
        call.setMethodName("getLastTrade");
       
        Vector params = new Vector();
        params.addElement (new Parameter("symbol", String.class, "SAPE", null));
        call.setParams(params);
       
        Response resp = call.invoke(new URL("http://sfc7dtnt-wyoung:100/axis/services/QuoteService"), "");
        System.out.println("Axis quote orig: " + resp.getReturnValue().getValue());


Is it because the result:

   <getLastTradeResult xsi:type="xsd:float">5.07</getLastTradeResult>

returned needs to have SOAP-ENV:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/ in the tag?  If yes...why isn't it being returned by my AXIS web service?

Thanks,
Will Young

Reply via email to