‎2015 Nov 20 11:17 AM
Hi ,
I am trying to consume an external rest service in ABAP.
I am having an issue with the IF_HTTP_CLIENT~RECEIVE method.
It hangs indefinitely. If you have encountered same issue please help.
CLEAR w_string .
w_string = "https//:XXXx.com"
CALL METHOD cl_http_client=>create_by_url
EXPORTING
url = w_string
IMPORTING
client = http_client
EXCEPTIONS
argument_not_found = 1
plugin_not_active = 2
internal_error = 3
OTHERS = 4. CALL METHOD http_client->send
EXCEPTIONS
http_communication_failure = 1
http_invalid_state = 2. CALL METHOD http_client->receive
EXCEPTIONS
http_communication_failure = 1
http_invalid_state = 2
http_processing_failed = 3.
‎2015 Nov 20 11:21 AM
‎2015 Nov 20 11:24 AM
‎2015 Nov 20 11:34 AM
So you have create all the necessary data : SOAMANGER / LPCONFIG / ....
*---------------------------------------------------------------------*
* Form P_SEND_FILE. *
*---------------------------------------------------------------------*
*---------------------------------------------------------------------*
form p_send_file.
data : ls_result type zaipwsimport_fichier_soap_out ,
ls_send type zaipwsimport_fichier_soap_in ,
ls_sys_exception type ref to cx_ai_system_fault ,
lv_string type string ,
lv_xstring type xstring .
* Créé le string.
concatenate lines of gt_tab into lv_string separated by space.
* Créé le XString
call function 'SCMS_STRING_TO_XSTRING'
exporting
text = lv_string
importing
buffer = lv_xstring
exceptions
failed = 1
others = 2.
ls_send-content = lv_xstring.
ls_send-str_directory = 'The directory'.
ls_send-str_file_name = 'The file name'.
try.
create object oo_proxy
exporting
logical_port_name = 'Fxxxxx_HTTPS_002'. " 'TxxxxxxIQ'.
catch cx_ai_system_fault into ls_sys_exception.
if ls_sys_exception is not initial.
write : /1 'System fault occured' ,
ls_sys_exception->code ,
ls_sys_exception->errortext .
endif.
endtry.
check oo_proxy is not initial.
try.
call method oo_proxy->import_document
exporting
import_fichier1 = ls_send
importing
import_fichier = ls_result.
catch cx_ai_system_fault into ls_sys_exception.
if ls_sys_exception is not initial.
write : /1 'System fault occured' ,
ls_sys_exception->code ,
ls_sys_exception->errortext .
endif.
catch cx_ai_application_fault .
endtry.
endform. " P_SEND_FILE.
‎2015 Nov 20 11:38 AM
‎2015 Nov 20 11:41 AM