Below is an example of HTTP Basic authentication with username 'johnsmith' and password 'sesame99'.
URL wsdl = getClass().getResource("myservice.wsdl.xml");
MyService service = new MyService(wsdl).getMyServicePort();
BindingProvider bp = (BindingProvider)service;
bp.getRequestContext().put(BindingProvider.USERNAME_PROPERTY, "johnsmith");
bp.getRequestContext().put(BindingProvider.PASSWORD_PROPERTY, "sesame99");
Hi Henning,
ReplyDeleteWould you provide a very simple cxf HTTP basic authentication webservice?
Thanks
Hi! Take a look at this article http://www.avajava.com/tutorials/lessons/how-do-i-use-basic-authentication-with-tomcat.html
ReplyDeleteHow you get service from port getter?
ReplyDeleteMyService service = new MyService(wsdl).getMyServicePort();