Alex,

Could you try the JAX-WS standard way of setting the username/password?

INFOServiceService ss = new INFOServiceService(SERVICE_URL,
                SERVICE_NAME);
INFOService port = ss.getINFOService();
BindingProvider bp = (BindingProvider)port;
bp.getRequestContext().put(BindingProvider.USERNAME_PROPERTY, "BJ");
bp.getRequestContext().put(BindingProvider.PASSWORD_PROPERTY, "pswd");


Dan


On Wednesday 25 July 2007 17:27, Axel Becker wrote:
> Hi,
>
> i generated the client code with the wsdl2java from an existing wsdl.
>
> now i want to connect to this service (it is an axis 1 webservice).
> the service ist protected with a http basic authentication. i use the
> following code, but it doesnt work :-(
>
> INFOServiceService ss = new INFOServiceService(SERVICE_URL,
> SERVICE_NAME);
>
> Client client = ClientProxy.getClient(ss.getINFOService());
> HTTPConduit httpConduit = (HTTPConduit) client.getConduit();
>
> httpConduit.getAuthorization().setUserName("username1");
> httpConduit.getProxyAuthorization().setUserName("username1");
>
> INFOService service = ss.getINFOService();
> //do somthing with service
>
> Where is the mistake?
>
> Thanks for your help!
> Axel
>
>
> PS: the serverside (axis1) code to get the auth parameter is:
> String username = MessageContext.getCurrentContext().getUsername();

-- 
J. Daniel Kulp
Principal Engineer
IONA
P: 781-902-8727    C: 508-380-7194
[EMAIL PROTECTED]
http://www.dankulp.com/blog

Reply via email to