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

From: Narinder Kumar <>
Date: Tue, 20 Jul 2004 12:53:07 +0200
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 ?
yes, you do need to set those properties. The dynamic proxy implements the StubIF so the same properties should be used.

Sorry for the late response but how can we set these properties on dynamic proxy object when it is during the creation of Service object itself we get the exception ?

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