tags:

views:

222

answers:

2

Hi i'm quite new in implementing web service client in java. i found a tutorial very useful...http://wso2.org/library/tutorials/creating-web-service-client-3-steps-using-eclipse.

in my case i got 401 error: Unauthorized. It is normal as to access the wsdl i need to type the username/password. how one can do in that case? Some input on the security part:

WWW-Authenticate Negotiate NTLM + web services +HTTP 401 so i don't know which java library can help me in that case and how to integrate it in my code.

thanks for your help Lana

A: 

It appears that the service might be using some kind of integrated windows authentication or sso.

Here's an open source library, http://spnego.sourceforge.net/protected_soap_service.html, that has an example of what you are attempting to do.

Pat Gonzalez
A: 

As mentioned, you're hitting a Web Service that has requires you authenticate with it. NTLM is an authentication mechanism typically used by a Microsoft stack. This WSO2 page describes how to configure Axis2 to authenticate using NTLM.

Unfortunately, that's not going to help if you're trying to do it through Eclipse. What I'd recommend in that case is to download the WSDL (I'm assuming you know the username and passsword) and when Eclipse asks you to "Select a Service Definition", use the local copy of the WSDL instead. You will need to code to supply the credentials, though, when you connect to the web service.

Edit: Edited to mention downloading the WSDL.

jamie mccrindle