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: 
Read only

HTTP_CLIENT->Receive: Communication failure error.

Former Member
0 Kudos
13,744

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
Read only

Former Member
0 Kudos
3,063

Hi

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

And check the link is correct or not.

regards.

laxman

Read only

0 Kudos
3,063

Hi Laxman,

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

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

regards,

NarsiReddy.

Read only

0 Kudos
3,063

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

Read only

0 Kudos
3,063

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.

Read only

Former Member
0 Kudos
3,063

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.


Read only

Katan
Active Participant
0 Kudos
3,063

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