Amit Rathore wrote:Ganesh,
Here is my code snippet:
// BasicHTTPAuthenticator is a subclass of java.net.Authenticator
Authenticator.setDefault(new BasicHTTPAuthenticator("myuser", "mypassword"));
// instantiate the endpoint impl. This Impl file is autogenerated as result of Weblogic ServiceGen
SupernovaWebServiceEndpoint_Impl ws = new SupernovaWebServiceEndpoint_Impl("http://myserver:9001/myws/snwebservice?WSDL");
// get the endPointPort
SupernovaWebServiceEndpointPort port = (SupernovaWebServiceEndpointPort) ws.getSupernovaWebServiceEndpointPort();
So in this code where will I add your suggested code. I thought setting Authenticator before invocation should've handled it and it does it successfully when it runs under tomcat.
Ulf Dittmer wrote:The proper way to secure a JAX-WS web service is really to use WS-Security, not HTTP authentication. All major JAX-WS implementations support that.
Axis2 does not support Rampart with JAX-WS service so we need to do HTTP or manual authentication.
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koophttps://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton