Skip to Content
avatar image
Former Member

webservice 401 problem

Hello all

I tried to consume a web service using webdynpro model. When I run the web service I get the following error:

java.rmi.RemoteException: Service call exception; nested exception is: : <b>Invalid Response Code: (401) Unauthorized</b>. The requested URL was:"http://<xxx>/<yyy>/xxxService.svc"

My colleague used this web service successfully by .NET and they told me that I should explicitly set UseDefaultCredentials to true.

They are using the following codes for using the webservise:

string url = " http://<xxx>/<yyy>/xxxService.svc ";

xxxService xxxWcfService = new xxxService (url);

<b>xxxWcfService.UseDefaultCredentials = true;</b>

How and where should I set UseDefaultCredentials to true in my webdynpro project?

I am using the following code for instancing and binding the webservise in wdDoInit() function of component controller:

Request_xxx req = new Request_xxx


and following codes for execute the web service:

wdContext.currentRequestElement ().modelObject().execute();

Thanks in advance

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Mar 20, 2007 at 07:21 PM

    Hi Yoel,

    I think that 'UseDefaultCredentials' in .NET passes to current user data to the Web Service.

    So, your credentials are sent to the server.

    Assuming your colleague is running the Web Service from <b>his</b> computer then <b>his</b> Credentials are sent and authenticated.

    Try to run the .NET appilcation from your computer (under your account).

    Also, ask your colleague for username & password and pass them to the WebService like this:



    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Mar 21, 2007 at 02:38 AM

    Check this too /people/anilkumar.vippagunta2/blog/2006/12/13/secured-webservices-ii


    Add comment
    10|10000 characters needed characters exceeded

  • Mar 21, 2007 at 08:36 AM

    Hi Yoel,

    I think you want to pass the current user credential to ur application. So u can use SAP Logon Ticket for the same. This will create a ticket and send that ticket to the portal, where user will check for the credentials.

    You can find more on SSO at


    PS : please reward points.

    Abhinav Sharma

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Yeol,

      Look into Note 958107 and use the diatool to check your SPNego setup.

      Maybe the below links could also help you.

      Quick guide for setting up SSo between EP and r/3:


      Connecting SAP systems to Enterprise portal with SSO.


      How to setup R/3 Reference system for User Mapping


      Hope that helps.