Re: Communication problem between Apache-Axis WebService and JWSDP client

From: Narinder Kumar <>
Date: Mon, 5 Jul 2004 14:41:38 +0200
Hi All,

I did not get any response about my earlier query, so resending again. Plus I have some related questions which are at the end of this mail.


Narinder Kumar wrote on 02/07/2004, 15:50:


I am trying to implement a JAX-RPC client for a Web Service implemented using Apache-Axis running on Tomcat 4.1.

I am implementing static stub client and used wscompile (JWSDP 1.3) for generating stubs. The instantiation of stub passes normally but while calling a method on WebService it throws an exception saying :

        deserialization error: deserialization error: unexpected XML reader state. expected:
 END but found: START: country
java.rmi.RemoteException: Runtime exception; nested exception is:
        deserialization error: deserialization error: unexpected XML reader state. expected:
 END but found: START: country
        at com.sun.xml.rpc.client.StreamingSender._handleRuntimeExceptionInSend(StreamingSen
        at com.sun.xml.rpc.client.StreamingSender._send(
        at FogWSDynClient.main(
Caused by: deserialization error: deserialization error: unexpected XML reader state. expect
ed: END but found: START: country
        at com.sun.xml.rpc.encoding.SOAPDeserializationContext.deserializeMultiRefObjects(SO
        at com.sun.xml.rpc.client.StreamingSender._send(
        ... 2 more

Some more details about Web Service method : Both input parameter and return type are user defined complex types, which are implemented as Java Beans. What can be the reasons, Are there any compatibility issues between Apache-Axis and JWSDP ?

I did search on the forum and found there were some issues related to complex types. Someone had suggested to generate stubs using "-f:searchschema" option but that also does not help in my case.


In the mean time I used the standard Dynamic Client procedure (which is not implementation specific) and tried to access Apache-Axis WebService, and it works fine for me. Does that confirm my doubt that Static Stub Client code like the one below is going to work only for SUN-JWSDP WebService and its clients and thus should be avoided when communicating between different web service implementations :

    private static Stub createProxy() throws Exception {
        try {
           return (Stub) (new MyWebService_Impl().getMyWebServiceIFPort());
        } catch (Exception ex) {
            throw new Exception (ex.toString());

That raises another question related to Security/Authentication between WebService/Client :

In my webservice implemented using JWSDP-1.3, I use Tomcat BASIC Authentication mechanism in web.xml specifying a username/password :


When using Static client (implementation specific), we can set the properties for username/password by doing :

            Stub stub = (Stub) (new
            stub._setProperty(javax.xml.rpc.Stub.USERNAME_PROPERTY, "peemsadmin");
            stub._setProperty(javax.xml.rpc.Stub.PASSWORD_PROPERTY, "peemsadmin");
            stub._setProperty(javax.xml.rpc.Stub.ENDPOINT_ADDRESS_PROPERTY, endpointAddress);
            myPeems = (PeemsIF) stub;

But when we follow the standard procedure of creating a service proxy (Dynamic Client) through ServiceFactory, we get HTTP 401 exception :

        static String endpointAddress = "http://localhost:8080/peemswebservice/PeemsWS";
        static String UrlString = "http://localhost:8080/peemswebservice/PeemsWS?WSDL";
        static String nameSpaceUri = "urn:Foo";
        static String serviceName = "PeemsWebService";
        static String portName = "PeemsIFPort";
        URL peemsWSDLUrl = new URL(UrlString);
        PeemsIF myProxy = null;
        ServiceFactory serviceFactory = ServiceFactory.newInstance();

        Service peemsWService = serviceFactory.createService
                                (peemsWSDLUrl, new QName(nameSpaceUri, serviceName));

Exception :      [java] modeler error: failed to parse document at "http://localhost:8080/peemswebservic
e/PeemsWS?WSDL": Server returned HTTP response code: 401 for URL: http:

My question is : How should we set
javax.xml.rpc.Stub.USERNAME_PROPERTY and javax.xml.rpc.Stub.PASSWORD_PROPERTY while using Dynamic proxy client procedure ?

--------------------------------------------------------------------- To unsubscribe, e-mail: For additional commands, e-mail: