Application Development 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_communication_Failure error in if_http_client->receive method

0 Kudos

Dear Experts,

I have one requirement for sending sms. I have developed this sms scenario as per requirement but this requirement is working fine in development and quality system not working in production system.For sms scenario , we are passing third party url to code. I had debugged the code in production system but i got http_communication_failure error in

if_http_client->receive method. why it is giving this error in production system. Can you please help me on this issue. It would be helpful to me.

Regards,

Puneet Mittal

1 ACCEPTED SOLUTION

prad_k
Explorer
0 Kudos

Hi Puneet Mittal,

Try using Function module HTTP_POST to call
external URL.

CALL FUNCTION 'HTTP_POST'

  EXPORTING

       ABSOLUTE_URI                        =  <YOUR URL HERE>

      RFC_DESTINATION                   =  'SAPHTTP'

IMPORTING

    STATUS_CODE                           = STATUS_CODE

    STATUS_TEXT                            = STATUS_TEXT

  TABLES

    REQUEST_ENTITY_BODY          = REQUEST_ENTITY_BODY

    RESPONSE_ENTITY_BODY       = RESPONSE_ENTITY_BODY

    RESPONSE_HEADERS              = RESPONSE_HEADERS

    REQUEST_HEADERS                = REQUEST_HEADERS.

10 REPLIES 10

former_member216168
Active Participant
0 Kudos

Could you explain better what kind of error is happening?

IF_HTTP_CLIENT is a interface which has some implementations, such as CL_HTTP_CLIENT class. There is tree exceptions in this class:

HTTP_COMMUNICATION_FAILURE

HTTP_INVALID_STATE

HTTP_PROCESSING_FAILED

Try to check wich errorcode return debugging this method

0 Kudos

Hi Alves,

I got sy-subrc = 1 i.e. http_communication_failure. error and response method gives application server error <> 404 resource not found.

Regards,

Puneet Mittal

0 Kudos

It seems you have no permission in Production to do that.

Try to check with basis, probably he can handle it

0 Kudos

Thanks for reply . But in quality system it is working fine but not working on production system. Is there any settings we missed out. Can you help me out.

Regards,

Puneet Mittal

0 Kudos

Hi,

HTTP 404 means the connection to the server is fine but server is not able to run what was requested. When you say it works fine in Q but not P, are you sure you are using the same URL in both the system. It seems the URL you are using in P is not right. Check for Carriage Return/Line feed in the URL string.

If it is same try these methods out to refresh content first from the same class CL_HTTP_CLIENT.

IF_HTTP_CLIENT~REFRESH_COOKIE

IF_HTTP_CLIENT~REFRESH_REQUEST

IF_HTTP_CLIENT~REFRESH_RESPONSE

R

0 Kudos

Thanks Rudra !!!!

We need to call these methods after result method. Is it right ?

Regards,

Puneet Mittal

0 Kudos

I would do it before the SEND method.

0 Kudos

Dear Rudra,

Firstly thanks for giving information.

But this scenario is working fine in development system as well quality system but not working on production system. I don't think it will resolve this issue.

Is there any settings need to be done by basis team for sending sms ?

If yes , is it possible to send the list.

Regards,

Puneet Mittal

prad_k
Explorer
0 Kudos

Hi Puneet Mittal,

Try using Function module HTTP_POST to call
external URL.

CALL FUNCTION 'HTTP_POST'

  EXPORTING

       ABSOLUTE_URI                        =  <YOUR URL HERE>

      RFC_DESTINATION                   =  'SAPHTTP'

IMPORTING

    STATUS_CODE                           = STATUS_CODE

    STATUS_TEXT                            = STATUS_TEXT

  TABLES

    REQUEST_ENTITY_BODY          = REQUEST_ENTITY_BODY

    RESPONSE_ENTITY_BODY       = RESPONSE_ENTITY_BODY

    RESPONSE_HEADERS              = RESPONSE_HEADERS

    REQUEST_HEADERS                = REQUEST_HEADERS.

0 Kudos

Firstly thanks to all for support me !!!

My issue has been resolved.

Regards,

Puneet Mittal