You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have to thank you so very much for providing the plugins you have created. I am really hoping they can help me create an ABAP program interface to connect to an external RESTful web service using JSON, but so far, I have been searching everywhere I can think of but I'm not finding any clear examples of how to use this stuff.
Unfortunately, I am a long time ABAP developer and never really got into the web side of things. I understand some concepts regarding HTML and HTTP communication, but REST and JSON are very new to me. Can you please point me to a step-by-step example in ABAP (via SAPGui, not Eclipse and we are not on 7.4 yet) showing exactly how I need to call a REST service?
So far, I am using the CL_HTTP_CLIENT class CREATE_BY_DESTINATION method to open a connection to the external service using Basic Authentication. The base URL is secure.smartwaregroup.com and our path is /Bigfoot/PABCO with various method subpaths depending upon the specific function we need to call.
My trouble spot has been trying to call their /api/login method where I need to pass the LoginName, Password, CultureCode ('en-US'), and Expires (120 minutes) parameters but I'm having trouble with the HTTP / REST / JSON syntax using the ABAP CL_HTTP_CLIENT class.
I have called CL_HTTP_CLIENT->REQUEST->SET_HEADER_FIELD to set the values: '~server_protocol' = 'HTTP/1.1', 'Accept' = 'application/json', and 'Content-Type' = 'application/json; charset=utf-8'.
I have also called CL_HTTP_CLIENT->REQUEST->SET_METHOD to set the method to POST and CL_HTTP_UTILITY=>SET_REQUEST_URI to the full method path /Bigfoot/PABCO/api/login.
I have tried setting the login parameters as form fields, but I think they need it in JSON format, so I then just hardcoded what they expect and called CL_HTTP_CLIENT->REQUEST->SET_CDATA but their server returns a login screen as if my request was rejected. It should instead return a session ID.
Am I on the right track?? Does the SET_CDATA (or SET_DATA) method place the specified content into the "payload" or should I be doing something else?
Thank you so much for any assistance you can provide.
Bryan
The text was updated successfully, but these errors were encountered:
I was not familiar with SCN. Thanks. I have however seen many of those posts via SDN and just Google, but I will finish looking through the ones I have not already seen.
I have to thank you so very much for providing the plugins you have created. I am really hoping they can help me create an ABAP program interface to connect to an external RESTful web service using JSON, but so far, I have been searching everywhere I can think of but I'm not finding any clear examples of how to use this stuff.
Unfortunately, I am a long time ABAP developer and never really got into the web side of things. I understand some concepts regarding HTML and HTTP communication, but REST and JSON are very new to me. Can you please point me to a step-by-step example in ABAP (via SAPGui, not Eclipse and we are not on 7.4 yet) showing exactly how I need to call a REST service?
So far, I am using the CL_HTTP_CLIENT class CREATE_BY_DESTINATION method to open a connection to the external service using Basic Authentication. The base URL is secure.smartwaregroup.com and our path is /Bigfoot/PABCO with various method subpaths depending upon the specific function we need to call.
My trouble spot has been trying to call their /api/login method where I need to pass the LoginName, Password, CultureCode ('en-US'), and Expires (120 minutes) parameters but I'm having trouble with the HTTP / REST / JSON syntax using the ABAP CL_HTTP_CLIENT class.
I have called CL_HTTP_CLIENT->REQUEST->SET_HEADER_FIELD to set the values: '~server_protocol' = 'HTTP/1.1', 'Accept' = 'application/json', and 'Content-Type' = 'application/json; charset=utf-8'.
I have also called CL_HTTP_CLIENT->REQUEST->SET_METHOD to set the method to POST and CL_HTTP_UTILITY=>SET_REQUEST_URI to the full method path /Bigfoot/PABCO/api/login.
I have tried setting the login parameters as form fields, but I think they need it in JSON format, so I then just hardcoded what they expect and called CL_HTTP_CLIENT->REQUEST->SET_CDATA but their server returns a login screen as if my request was rejected. It should instead return a session ID.
Am I on the right track?? Does the SET_CDATA (or SET_DATA) method place the specified content into the "payload" or should I be doing something else?
Thank you so much for any assistance you can provide.
Bryan
The text was updated successfully, but these errors were encountered: