‎2009 Jul 09 2:24 PM
Hi Experts,
i have a requirement to transfer a XML file to Https server.
i have instaleed SSL certificate in SAP.
can u guide me ho to transfer this XML file to Https server using ABAP.
i searched in sdn.but stilll my problem was not solved.
Thanks
Sai
‎2009 Jul 10 4:48 AM
Hi sabu,
thank u for ur repl;y.but ithink it is only for https but not https
thanks
sai
‎2009 Jul 09 7:16 PM
‎2009 Jul 10 4:48 AM
Hi sabu,
thank u for ur repl;y.but ithink it is only for https but not https
thanks
sai
‎2009 Sep 22 7:46 AM
Hi Sai,
I've the same requirement to post XML document into HTTPS serverf from ABAP. Have you managed to get this up and running ?
Thank you.
Regards,
Danny
‎2009 Sep 22 2:26 PM
Thomas Jung did a nice e-learning tutorial on SDN on HTTPS communication with Polestar. I have posted an example of HTTPS communication between Paypal's Payflow gateway and SAP on Paypal's developer forum as well. For XML, the only real difference is that you will set your content type to 'text/xml' instead of 'text/namevalue'. Here is a simplified example I used for testing with Paypal's reporting engine:
* Create HTTP client object
CALL METHOD CL_HTTP_CLIENT=>CREATE_BY_DESTINATION
EXPORTING
DESTINATION = 'PAYPAL_REPORTING'
IMPORTING
CLIENT = GV_CLIENT
EXCEPTIONS
DESTINATION_NOT_FOUND = 1
INTERNAL_ERROR = 2.
IF SY-SUBRC NE 0.
MESSAGE E184 WITH SY-SUBRC.
ENDIF.
* Build the request
* HEADER
CALL METHOD GV_CLIENT->REQUEST->SET_METHOD
EXPORTING
METHOD = GV_CLIENT->REQUEST->CO_REQUEST_METHOD_POST.
CALL METHOD GV_CLIENT->REQUEST->SET_CONTENT_TYPE
EXPORTING
CONTENT_TYPE = 'text/xml'.
CALL METHOD GV_CLIENT->REQUEST->SET_HEADER_FIELD
EXPORTING
NAME = 'Connect'
VALUE = 'close'.
CALL METHOD GV_CLIENT->REQUEST->SET_HEADER_FIELD
EXPORTING
NAME = 'Host'
VALUE = 'https://payments-reports.paypal.com'.
CALL METHOD GV_CLIENT->REQUEST->SET_VERSION
EXPORTING
VERSION = GV_CLIENT->REQUEST->CO_PROTOCOL_VERSION_1_1.
* BODY
* GUI_UPLOAD called here to get XML file for testing ...
SHIFT GV_XML_REQUEST LEFT DELETING LEADING SPACE.
CALL METHOD GV_CLIENT->REQUEST->APPEND_CDATA2
EXPORTING
DATA = GV_XML_REQUEST.
* Get the length of the body
CALL METHOD GV_CLIENT->REQUEST->IF_HTTP_ENTITY~GET_DATA_LENGTH
IMPORTING
DATA_LENGTH = GV_LEN.
* Set the length in the header
GV_STRING = GV_LEN.
CALL METHOD GV_CLIENT->REQUEST->SET_HEADER_FIELD
EXPORTING
NAME = '~Content-Length'
VALUE = GV_STRING.
* Now send the request
CALL METHOD GV_CLIENT->SEND
EXCEPTIONS
HTTP_COMMUNICATION_FAILURE = 1
HTTP_INVALID_STATE = 2.
IF SY-SUBRC NE 0.
CALL METHOD GV_CLIENT->GET_LAST_ERROR
IMPORTING
CODE = GV_SUBRC
MESSAGE = GV_STRING.
WRITE:/ 'Send Error:', GV_STRING.
EXIT.
ENDIF.
* Get the response from the ICM
* Receive code goes here...