Hello,
I am calling a .NET Web service that uses NTLM authentication. How do I pass the credentials to the web service from my JAX-RPC Client.
thanks,
Ravi
SCJP, SCWCD5, SCBCD5, SCDJWS
IBM Certified Websphere 6.1 Core Admin
IBM Certified SOA Solution Designer
SCEA Part 1
Given that there is no official specification for NTLM (this is the closest description) support of NTLM in combination with JAX-RPC would be highly vendor dependent.
If you are bound to using NTLM then using an Axis2 client would the easiest route. Axis2 clients use the Jarkarta Commons HttpClient which can deal with NTLM.
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.
Peer Reynders
Bartender
Joined: Aug 19, 2005
Posts: 2906
posted
0
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).
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.