on 08-03-2009 1:05 PM
Hi everybody!
I am developing a web dynpro component and I need to get the value of the MYSAPSSO2 cookie. I have tried hard but I can not get that value. I am using the classes if_http_client, if_http_server and if_http_request but I sting have not get any result. I do not what I am doing wrong or whether I am completely lost.
My program:
path_sap = 'http://sapdes.metrovacesa.es:8002/sap/bc/webdynpro/sap/zwd_docs_empleado?sap-language=ES'.
name_Cookie = 'MYSAPSSO2'.
CALL METHOD cl_http_client=>create_by_url
EXPORTING
url = path_sap
IMPORTING
client = http_client
EXCEPTIONS
argument_not_found = 1
plugin_not_active = 2
internal_error = 3
OTHERS = 4.
CALL METHOD HTTP_CLIENT->request->get_cookie
exporting
name = name_Cookie
path = '/''
importing
value = value_Cookie.
sap_path is the url of the web dynpro component. Can somebody help me?
Greetings from Spain.
Web dynpro applications should never be designed to interact with client side cookies becuause doing so would break the client independence ( what happens if your WD applicaiton runs in the NWBC SmartClient or the Flex Client?). CL_HTTP_CLIENT class is use when you want ABAP to act as the web browser and make an HTTP call to another server. It can't be used to interact with the incomming request object from within Web Dynpro.
Why do you want to access the SSO cookie in the first place?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
My application has to call a web service that is located in another server. In this call, I need to send the value of the cookie as a paremeter because the web service validate the user. This is the reason why I try to get the cookie first. I do not know if I need to use de HTTP_CLIENT or I could retrieve the cookie value in a different way.
After retrieving the cookie, I am calling a web service with HTTP_CLIENT class and it is running OK (Obviusly I wrote hard code instead of the cookie value).
Thanks!
I seriously doubt the reuse of the SSO cookie would be supported in such a manner. The SSO cookie would only work with another SAP system - ABAP or JAVA. Why would you use HTTP_CLIENT class directly if talking to another SAP system.
At the least you should use an RFC destination (of type G - HTTP) and use the Logon & Security tab to specify that you want to Send a Logon Ticket.
>
> So that, you don't know the solucion, do you?
I do believe that I recommend a solution to you earlier based upon the use of a HTTP Destination from SM59. This would be the only SAP supported approach to using a SSO ticket in the way you describe.
You should not try and hi-jack the SSO ticket that was generated for the browser access to a WDA application.
I never said to use RFC. I said that you sue use an HTTP destination that has been setup in SM59. This allows for greater control over the connection parameters, but this SM59 destination can still be used with CL_HTTP_CLIENT. It just means that you would use CL_HTTP_CLIENT=>CREATE_BY_DESTINATION as the starting point of your CL_HTTP_CLIENT_CODING.
Hi ,
Refer to the link:
http://help.sap.com/saphelp_nw04/helpdata/en/2a/31b97b35a111d5992100508b6b8b11/frameset.htm
Regards,
Dhanalakshmi L
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.