axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mark Volkmann" <volkma...@charter.net>
Subject difference in user guide request and actual
Date Sun, 27 Jan 2002 16:32:50 GMT
I'm trying to run the basic sample in the "Consuming Web Services" section
of the user's guide. Here is my code. I had to modify it slightly since
apparently you are no longer supposed to set the web service namespace by
calling call.setProperty(). If this is true then the user's guide needs to
be updated.

import javax.xml.rpc.namespace.QName;
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;

public class Sample {
    private static final String ENDPOINT =
        "http://nagoya.apache.org:5049/axis/servlet/AxisServlet";

    public static void main(String [] args) throws Exception {
        Service service = new Service();
        Call call = (Call) service.createCall();
        call.setTargetEndpointAddress(new java.net.URL(ENDPOINT));
        call.setOperationName(new QName("http://soapinterop.org/",
"echoString"));
        String ret = (String) call.invoke(new Object[] {"Hello!"});
        System.out.println("Sent 'Hello!', got '" + ret + "'");
    }
}

When I run this I get

org.xml.sax.SAXException: Deserializing parameter 'arg0':  could not
find deserializer for type http://www.w3.org/2001/06/soap-encoding:string

The user's guide says the that the request sent should look like this.

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"

xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <SOAP-ENV:Body>
    <ns1:echoString xmlns:ns1="http://soapinterop.org/">
      <arg0 xsi:type="xsd:string">Hello!</arg0>
    </ns1:echoString>
  </SOAP-ENV:Body>

When I use tcpmon I see that the request actually sent is

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
SOAP-ENV:encodingStyle="http://www.w3.org/2001/06/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:echoString xmlns:ns1="http://soapinterop.org/">
   <arg0 xsi:type="SOAP-ENC:string"
xmlns:SOAP-ENC="http://www.w3.org/2001/06/soap-encoding">Hello!</arg0>
  </ns1:echoString>
 </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

The difference is the SOAP-ENV:encodingStyle and the attributes on arg0.
Again, apparently the user's guide needs to be updated.

I'd appreciate any suggestions for how to get this basic example to work.
Thanks!


Mime
View raw message