This week's book giveaway is in the OCMJEA forum. We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line! See this thread for details.
Thanks for the replies. I did go thru those links. Most of them talk about passing credentials using Axis. In this case we have a JAX-RPC client with generated stubs that run on Websphere. I was not sure on cross platform interoperability.
Besides, I came across a class by name sun.net.www.protocol.http.NTLMAuthenication that takes a URL and PasswordAuthentication as parameters. But its got a restricted visibility that does not allow me to import the class. I have the endpoint URL and i was able to build a PasswordAuth object. If I could build the NTLMAuth object I can set this property on the stub. This is where I am stuck.
Joined: Aug 19, 2005
I suspect that is an internal class that is instantiated once the "WWW-Authenticate: NTLM" header is seen. Apparently you need to set up a subclass of java.net.Authenticator to return the required authentication information (see Http Authentication) and then set it as the default by calling java.net.Authenticator.setDefault(myAuthenticator). Of course this will only work if your JAX-RPC implementation actually uses the java.net.HttpURLConnection class.
Then again it may just be a matter of setting the correct properties as there is a http.auth.ntlm.domain property (see Networking Properties).