Skip to Content
author's profile photo Former Member
Former Member

(Java) Web Service Client & Authentication

Hi all,

I generated a WS client in my java project using the built-in functionality of the SAP NetWeaver Developer Studio. When executing the application (a servlet) I can see that it is working as the web service returns a "401" (unauthorized).

Thus I wanted to pass a username / password along, but cannot find the correct place to do so.

Any idea where I need to look for that? At best I could set it on Java level, but I couldn't find any API to do so.

Thanks / Best regards,


Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    Posted on Jul 21, 2009 at 08:01 AM

    Hi Martin

    It depends slightly on the AS Java version... If you have NW 7.1 you have to configure WS Logical Port for the web-service client. Logical Port's configuration allows to specify user/password for HTTP Basic authentication mode and other authentication/transport settings of the web-service client.

    You can do this (after you deployed your generated WS client on server) in NWA->SOA Configuration->Single Service Administration -> select the second tab with deployed WS clients, find your client, create new logical port if you do not see any default one, go to port's configuration -> authentication settings.

    Check also this docs:

    [Consuming a Web Service|],

    [Web Service Clients Development|]

    BR, Sergei

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.