on 05-15-2018 4:52 PM
when implementing a SAP Gateway Service (using DPC_EXT Classes), I'd like to access some custom cookies.
But I dont seem to be able to access them...
Using following code
lo_faqcade = /iwbep/if_mgw_conv_srv_runtime~get_dp_facade( ).
lo_facade->get_request_header( ).
I get all the HTTP Request headers (Except the Cookie Header, which always seems to be empty here)
Well, i finally got it working for me.
IF_HTTP_EXTENSION~HANDLE_REQUEST is called everytime when you make call with the HTTP/S requests of any type with SAP. you can implement this in the sicf service handler to store the cookie to user memory or do your logic.
Second way is to use the call stack and get the object variable: server from the standard IF_HTTP_EXTENSION~HANDLE_REQUEST implementation. then you can use the object to get it: some code:
DATA: lo_server TYPE REF TO cl_http_server_net.
FIELD-SYMBOLS: <server> TYPE any.
ASSIGN ('(SAPLHTTP_RUNTIME)server_accepted') TO <server>.
CHECK: <server> IS ASSIGNED.
lo_server ?= <server>.
lo_server->request->get_cookie( EXPORTING name = 'USERCOOKIE' IMPORTING value = rv_cookie ).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sergei/Sreehari,
Did you guys manage to do this?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
nope, unfortunately not.
also check https://stackoverflow.com/questions/50354585/read-cookies-in-sap-gateway-methods
Hay,
Were you able to get a solution ?
I was also trying to read/write cookies in OData context. Ended up nowhere .
Sreehari
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
No, unfortunately not. you could upvote the question, maybe it gets a higher awareness...
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
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.