on 06-02-2008 5:17 PM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
10 | |
10 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.