on 03-20-2007 5:22 PM
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: com.sap.engine.services.webservices.jaxrpc.exceptions.InvalidResponseCodeException : <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
wdContext.nodeRequest_xxx().bind(req);
and following codes for execute the web service:
wdContext.currentRequestElement ().modelObject().execute();
Thanks in advance
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
<a href="http://help.sap.com/saphelp_nw04s/helpdata/en/42/de20c8157b162fe10000000a1553f7/content.htm">here</a>
PS : please reward points.
Abhinav Sharma
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Abhinav Sharma,
You right. That is exactly what I need. We are using SPNego (Kerberos) authentication for SSO in our portal (WAS 640). So why it is not working and what is simplest way to solve this problem?
What is corresponding in java (webdynpro) to this statement?
xxxWcfService.UseDefaultCredentials = true
Simply forwarding user and password by
xxxWcfService._setUser(user)
xxxWcfService._setPassword(password)
not works.
Thanks in advance
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:
/people/sap.user72/blog/2004/09/15/quick-guide-for-setting-up-sso-between-ep-and-r3
Connecting SAP systems to Enterprise portal with SSO.
/people/dennis.kleymeonov/blog/2005/09/15/connecting-sap-systems-to-enterprise-portal-with-sso
How to setup R/3 Reference system for User Mapping
/people/gregor.wolf3/blog/2005/02/11/how-to-setup-r3-reference-system-for-user-mapping
Hope that helps.
Check this too /people/anilkumar.vippagunta2/blog/2006/12/13/secured-webservices-ii
Regards,Anilkumar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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:
xxxWcfService._setUser(user)
xxxWcfService._setPassword(password)
Omri
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
98 | |
11 | |
11 | |
10 | |
10 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.