Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

HTTP_CLIENT->Receive: Communication failure error.

Former Member
0 Kudos
13,581

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( ).

6 REPLIES 6

Former Member
0 Kudos
2,900

Hi

Once check that link in your browser, copy and paste.

And check the link is correct or not.

regards.

laxman

0 Kudos
2,900

Hi Laxman,

In the website it is specified to ask in that way.

BZSt: USt-IdNr. Best&amp;auml;tigung

regards,

NarsiReddy.

0 Kudos
2,900

I didnt understand what u said.

once i jave faced problem like this communication failure, at that that my link hase been modified by the third party sms system.

so please check.

regards.

laxman

0 Kudos
2,900

HI Laxman,

In that website it was specified that:

Example syntax for a simple confirmation request:

https://evatr.bff-online.de/evatrRPC?UstId_1=DE123456789&UstId_2=AB1234567890&Firmenname=

& Location = & ZIP = & Street = & print =

Please suggest me if i was wrong..

regards,

NarsiReddy.

Former Member
0 Kudos
2,900

Hi ,

Can you please help me solve this error?

When i am using "CALL FUNCTION 'HTTP_GET'". I am getting the result in some XML format.

But when i use create, send and receive as in original post, I am getting communication error in the receive method.

Thanks in advance ,

regards,

NarsiReddy Cheruku.


Katan
Active Participant
0 Kudos
2,900

Hi,

A communication issue might mean that the SAP system may not be able to connect to host evatr.bff-online.de


To test this get your infrastructure guys to "telnet" from the SAP instance operating system to that host with port 80. 


It is not likely your SAP environment will be allowed (due to firewall rules) to directly access the internet. This is pretty normal in most companies. 


You may need to go via a proxy server (see importing params PROXY_HOST and PROXY_SERVICE of method CREATE_BY_URL), if your company has one available to go out to the internet from your network.  Your infrasructure team should be able to help confirm this and tell you the details. 


Hope that helps.


Cheers,


Katan