Hi Axel,

I checked the HTTPConduit code, your way to set the http basic authentication is right.

Can you use tcpmon to check the authentication informantion has been set into the http headers?

If not, I think it must be the CXF's bug.


Willem.

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();


Reply via email to