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

METHOD cl_http_client=>create_by_url 404 Not Found Error

Former Member
0 Likes
3,525

Dear Experts,

Good day. I am using  HTTP_CLIENT to download image from URL. The program perfectly working in client 150 ( development ) . But the same program does not work in Client 300 ( development test ). Same servers but different client. I have tried to search in SCN but couldn't find any relevant. Really appreciate if could get some input .Please find my code below.

CALL METHOD cl_http_client=>create_by_url

   EXPORTING

     url                = url

   IMPORTING

     client             = http_client

   EXCEPTIONS

     argument_not_found = 1

     plugin_not_active  = 2

     internal_error     = 3

     OTHERS             = 4.

IF sy-subrc = 0.

     http_client->send( ).

     http_client->receive( ).

     CALL METHOD http_client->response->get_status

       IMPORTING

         code   = lv_i

         reason = err_string.


  content = http_client->response->get_data( ).

     http_client->close( ).

Regards

Shankar

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,827

It looks like something is missing on the "settings side" of the system.

in fact, if it is running in a client (150) from a technical point of view should be fine also in any other client.

Take a look at Client Architecture - Components of SAP Communication Technology - SAP Library

Best regards.

Dear Experts,

Good day. I am using  HTTP_CLIENT to download image from URL. The program perfectly working in client 150 ( development ) . But the same program does not work in Client 300 ( development test ). Same servers but different client. I have tried to search in SCN but couldn't find any relevant. Really appreciate if could get some input .Please find my code below.

CALL METHOD cl_http_client=>create_by_url

   EXPORTING

     url                = url

   IMPORTING

     client             = http_client

   EXCEPTIONS

     argument_not_found = 1

     plugin_not_active  = 2

     internal_error     = 3

     OTHERS             = 4.

IF sy-subrc = 0.

     http_client->send( ).

     http_client->receive( ).

     CALL METHOD http_client->response->get_status

       IMPORTING

         code   = lv_i

         reason = err_string.


  content = http_client->response->get_data( ).

     http_client->close( ).

Regards

Shankar

3 REPLIES 3
Read only

Former Member
0 Likes
1,828

It looks like something is missing on the "settings side" of the system.

in fact, if it is running in a client (150) from a technical point of view should be fine also in any other client.

Take a look at Client Architecture - Components of SAP Communication Technology - SAP Library

Best regards.

Read only

0 Likes
1,827

Hi Francesco,

Thanks for the input . The link was useful. But i couldn't find any hint from the link related to this issue.

Thanks and Regards

Shankar

Read only

Former Member
0 Likes
1,827

I have solved the issue by using FM HTTP_GET which has the same functionality.



CALL FUNCTION 'HTTP_GET'

     EXPORTING

       absolute_uri                = lv_url

     IMPORTING

       response_entity_body_length = lv_length

     TABLES

       response_entity_body        = i_tab_data

       response_headers            = i_tab_response_headers

     EXCEPTIONS

       connect_failed              = 1

       timeout                     = 2

       internal_error              = 3

       tcpip_error                 = 4

       data_error                  = 5

       system_failure              = 6

       communication_failure       = 7

       OTHERS                      = 8.

   IF sy-subrc <> 0.

     e_message-msg_txt = '404 NOT FOUND!'  .

     EXIT.

   ENDIF.