cancel
Showing results for 
Search instead for 
Did you mean: 

Web Service Client in WebDynPro and SAP Logon Ticket

Former Member
0 Kudos

Hello,

I have a web service enabled EJB application running on WAS 6.40 SP9 and a WebDynPro client application using this web service (imported as a web service model). Both are running on the same app server.

The problem is that I want to secure the web service and need user credentials to access some backend functions, therefore I think the best way is to authenticate against the web service using SAP Logon ticket created when the user authenticates on the webdynpro logon screen.

By no means I have been able to make it work, so far all I can do is set the web service for HTTP basic authentication and pass a fixed user id and password from webdynpro. This is not what I need.

Documentation is very limited about using SAP Logon ticket with web services and did not find any example to realize this from WebDynPro.

SSO Ticket generation works perfectly between SAP Portal and WebDynPro. Just can't pass it over to web service.

I tried almost any combination of authentication settings both on the web service side and in the imported model in webdynpro client application.

Can anybody give some guidelines on how to achieve this and / or where to look for how to's?

Thanks in advance!

Regards,

Vitaliano

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

a lot of information available on Web services on the Web Service Homepage on the SAP Developer Network (SDN): https://www.sdn.sap.com/sdn/developerareas/webservices.sdn?node=linkDnode6-1.

Particularly useful might be

1) the recordings of last year's TechEd workshops (contain overview sections as well as demos): https://www.sdn.sap.com/sdn/events.sdn?page=teched04_sessions.htm. Choose "ABAP Development" (resp. "Java Development") --> "Intermediate Courses" --> "Utilizing Web Services with ABAP (resp. Java) and SAP Web Application Server"

2) the e-learning section: https://www.sdn.sap.com/sdn/developerareas/webservices.sdn?page=el_ws.htm

<b>http://help.sap.com/sapdocu/netweaver/webas/630/helpdata/EN/ab/c955e2e2d24a888127f211f2d5043f/content.htm</b>

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/documents/a1-8-4/using sap logon tickets for sso to microsoft-based web applications.pdf

Hope this helps

Regards,

RK

Former Member
0 Kudos

Hello Ramakrishna

I am still unable to pass the SSO Logon Ticket from WebDynPro to the WebService.

My application issues a logon ticket (which is valid because I SSO to other systems too) but when it calls the web service running on the same host (imported as a model in webdynpro) this SSO ticket is not passed back to the web service.

All my logon / authentication stack works fine, I am even able to SSO with other servers around here. All but web service from webdynpro.

I have the web service set for basic authentication plust SSO ticket and have the ticket evaluator on top of the authentication stack.

I start beleaving this is a bug in the auto generated proxy stub in webdynpro unless I am missing something but I went reading all docs and found nothing I did not try.

Any ideas ?

Former Member
0 Kudos

Is there any SAP developer guru that can give advices on how to propagate user credentials (in SSO Logon Ticket) from WebDynPro controller down to a web service which is imported as a model in webdynpro?

Please Help!

Former Member
0 Kudos

Dear Vitaliano,

I'm stuck with the same problem; maybe if we combine force we can eventually squeeze the information out of somebody It's a pity that the whole document dedicated to the topic (https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/documents/a1-8-4/how to configure sso in a complex system landscape.pdf) does not address this scenario.

Do you get an exception when trying to connect to the web service? I do, mine is a SocketException ("Software caused connection abort: recv failed").

Regards

Nils

Former Member
0 Kudos

Nils,

I was hoping this issue to be just my misunderstanding on SSO usage from webdynpro but it seems this is a webdynpro issue. This scenario not being addressed probably because not supported yet?

By the way I can access web services with no authentication or basic authentication with userid/password. By no means I have been able to pass user credentials with SSO ticket.

I have (deployable) webservices wrapping EJB session beans that work perfectly with SSO ticket when called by other means but when importing the web service model into WDP it builds it's own local proxy classes and does not seem to handle SSO.

I could access the deployable web service via JNDI by my own but in this way I have to manage the complete model by myself and write a lot of code...

Still waiting SAP gurus.

If you find a workaround let me know

Regards !

Vitaliano

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Martin,

I did the same thing as u have suggested for calling webservice from webdynpro using Logon ticket.

But i am getting following error :

Service call exception; nested exception is: com.sap.engine.services.webservices.jaxrpc.exceptions.InvalidResponseCodeException: Invalid Response Code: (401) Unauthorized.

Can u please resolve it?

Thanks in Advance,

Bhavik

Abhinav_Sharma
Contributor
0 Kudos

Hi Gurus,

Did any one solve this problem?I'm facing same problem.

Regards

Abhinav Sharma

Former Member
0 Kudos

Dear Vitaliano,

Did you find any way to access the web service from dynpro using single sign on.

can you tell me how you were able to access the web service using SAP Logon ticket using different means i.e. other then dynpro.

i would like to know how to pass SAP Logon ticket to web service (i.e. via HTTP header on any other mean)

Thanks

martijndeboer
Advisor
Advisor
0 Kudos

Hi,

With SP10 and later the Web Dynpro Web Service Model lets you use an HTTP destination from the J2EE destination service for configuring authentication and URL.

How it works:

1) At design time, you specify the name of the destination adding a line of code in you WD application:

Request_QuickCarRentalServiceViDocument_viewActiveBookings modObj
                  = wdContext.currentActiveBookingsElement().modelObject();
         <b>modObj._setHTTPDestinationName("CarRental");</b>
         modObj.execute();

2) In the Visual Administrator, go to the "Destination" service and create a "HTTP" destination "CarRental" (or whatever you have in your code)

If you want to use SAP Logon Tickets, configure "Authentication: SAP Logon Tickets".

You may also specify the URL to be used in the destination. The behaviour is the following:

URL field empty: use URL specified in the IDE

URL field set: use URL of the destination

It is also described as part of an UME tutorial. See http://help.sap.com/saphelp_nw04/helpdata/en/d1/8d4c4005a99523e10000000a1550b0/frameset.htm

<b>NOTE</b>: This solution only works when you are using <i>SAP Developer Studio SP10</i> and <i>NW04 Stack 10</i>.

Best Regards,

Martijn de Boer