Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9080

HTTP_CLIENT->Receive: Communication failure error.

$
0
0

Hi All,

 

I am trying to send and receive the data from (BZSt: USt-IdNr. Bestätigung), i had used the methods in CL_HTTP_CLIENT class. But in the receive method i am getting Communication failure error.

 

Below is the Code, Please suggest me where i went wrong.

 

 

REPORT ZZ_N_TEST4.
data i_url TYPE string.
data i_client type ref to if_http_client.
DATA p_ustid TYPE stceg.
DATA pu_ustid TYPE stceg.
data: w_string type string ,  w_result type string ,  r_str  type string .
p_ustid = 'XXXXXXX'.
pu_ustid = 'XXXXXXX'.
CONCATENATE 'http://evatr.bff-online.de/evatrRPC?UstId_1=' p_ustid '&UstId_2=' pu_ustid   '&Druck=nein' INTO i_url.
CALL METHOD cl_http_client=>create_by_url  EXPORTING  url = i_url  IMPORTING   client  = i_client
call method i_client->send   exceptions  http_communication_failure = 1  http_invalid_state  = 2.
IF sy-subrc <> 0.
write: 'Error while send:', sy-subrc.
ENDIF.
call method i_client->receive   exceptions  http_communication_failure = 11  http_invalid_state  = 2  http_processing_failed  = 3.  clear w_result .
IF sy-subrc <> 0.
WRITE: 'Error While receiving:', sy-subrc.
ENDIF.
 w_result = i_client->response->get_cdata( ).

Viewing all articles
Browse latest Browse all 9080

Trending Articles