cancel
Showing results for 
Search instead for 
Did you mean: 

connection with password authentication problems

Former Member
0 Kudos

Hi experts,

I'm trying to retrieve an XML file from a server with password authentication. I'm using the following code:


url = new URL(myUrl);
URLConnection con = url.openConnection();
Authenticator.setDefault(new SimpleAuthenticator(username,password));
InputStream stream = con.getInputStream();
...

This works if I run the code in NWDS as JAVA APPLICATION.

If I deploy the same code on the web application server wraped with web service I get the error 401 UNAUTHORIZED as server response. The WAS runs on the same machine with the same system user.

Is class Authenticator the right one to use for authentication in the NWCE 7.1 Java EE 5 server?

Thanks in advance!

Best regards,

Kevin

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hi kevin,

what about creating a http destination, configure the authentication inside the nwa (e.g. using saplogonticket, if your ws runs inside the same webas instance) and

call the getConnection() via destination api

http://help.sap.com/saphelp_nw2004s/helpdata/en/8b/8e7dac1e661d44bf2a676fd3948cc6/frameset.htm

hth,

jens

Edited by: Jens Neuhaus on Jun 14, 2008 7:24 PM

Answers (0)