on 12-15-2010 1:50 AM
Hi,
Is call to https:// type URLs possible through ABAP code?
Can IF_HTTP_CLIENT be used in this case?
If no, what are the alternatives?
Please help.
Thanks and regards,
Amey
Hi,
I have a requirement to send XML data from ECC to 3rd party URL which starts with HTTPS://.
Can any body tell me " How to achieve this ".
Please share me the information regarding this.
Thanks in advance.
Regards,
Namdev
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Namdev,
Did you get any solution to send XML data from ECC to 3rd party URL which starts with HTTPS://?
I too have the same kind of requirement, can you please share the solution if you have achieved it?
Thanks in Adv..
Regards,
Nag
Resolved myself.
"STEP-1 : CREATE HTTP CLIENT
CALL METHOD CL_HTTP_CLIENT=>CREATE_BY_URL
EXPORTING
URL = WL_URL
IMPORTING
CLIENT = W_HTTP_CLIENT
EXCEPTIONS
ARGUMENT_NOT_FOUND = 1
PLUGIN_NOT_ACTIVE = 2
INTERNAL_ERROR = 3
OTHERS = 4
.
DATA: EMPTYBUFFER TYPE XSTRING.
EMPTYBUFFER = ''.
CALL METHOD W_HTTP_CLIENT->REQUEST->SET_DATA
EXPORTING DATA = EMPTYBUFFER.
"STEP-2 : AUTHENTICATE HTTP CLIENT
CALL METHOD W_HTTP_CLIENT->AUTHENTICATE
EXPORTING
USERNAME = 'user'
PASSWORD = 'password'
"LANGUAGE = SY-LANGU
.
CALL METHOD W_HTTP_CLIENT->REQUEST->SET_HEADER_FIELD
EXPORTING NAME = '~request_method'
VALUE = 'GET'
.
CALL METHOD W_HTTP_CLIENT->REQUEST->SET_HEADER_FIELD
EXPORTING NAME = 'Content-Type'
VALUE = 'text/xml; charset=utf-8'.
CALL METHOD W_HTTP_CLIENT->REQUEST->SET_HEADER_FIELD
EXPORTING NAME = 'Accept'
VALUE = 'text/xml, text/html'.
CONCATENATE WL_URL '#' INTO SOAP_ACTION.
CALL METHOD W_HTTP_CLIENT->REQUEST->SET_HEADER_FIELD
EXPORTING NAME = 'SOAPAction'
VALUE = SOAP_ACTION.
"STEP-3 : SEND HTTP REQUEST
CALL METHOD W_HTTP_CLIENT->SEND
EXCEPTIONS
HTTP_COMMUNICATION_FAILURE = 1
HTTP_INVALID_STATE = 2.
*-----------------------------------------------------------------
"STEP-4 : GET HTTP RESPONSE
CALL METHOD W_HTTP_CLIENT->RECEIVE
EXCEPTIONS
HTTP_COMMUNICATION_FAILURE = 1
HTTP_INVALID_STATE = 2
HTTP_PROCESSING_FAILED = 3.
"STEP-5 : Read HTTP RETURN CODE
CALL METHOD W_HTTP_CLIENT->RESPONSE->GET_STATUS
IMPORTING
CODE = HTTP_STATUS_CODE
REASON = STATUS_TEXT
.
WRITE: / 'HTTP_STATUS_CODE = ',
HTTP_STATUS_CODE,
/ 'STATUS_TEXT = ',
STATUS_TEXT
.
"STEP-6 : READ RESPONSE DATA
CALL METHOD W_HTTP_CLIENT->RESPONSE->GET_CDATA
RECEIVING DATA = W_RESULT .
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Amey,
I have a requirement to send an XML file from SAP to Third party URL starts with HTTPS://.
I would like to know, how can i achieve this task. Is your code will work for me also?
If yes please share the complete code. Also let me know is there any basis settings required for this task.
It is very urgent.. Thanks in Advance.
Regards,
Namdev
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.