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

Error HTTPIO_PLG_CANCELED when calling http_client->receive

Former Member
0 Likes
1,089

Hello,

I want to check the existence of a specific URL from ABAP. Here is the coding

report zmmrsl_check_url.

data: http_client type ref to if_http_client

     , result      type string

     , err_string  type string

     , code        type sy-subrc

     , lv_url      type string

     , subrc       type sysubrc

     , errortext   type string

     .

call method cl_http_client=>create

  exporting host  = 'www.anycompanie.de'

    service       = '443'

     scheme        = '2'

  importing client  = http_client

  exceptions

          argument_not_found = 1

          internal_error     = 2

          plugin_not_active  = 3

          others             = 4.

* set http method GET

call method http_client->request->set_method(

   if_http_request=>co_request_method_get ).

* set request uri (/<path>[?<querystring>])

cl_http_utility=>set_request_uri( request = http_client->request

                                    uri    = 'path/anyfile.jpg' ).

call method http_client->send

   exceptions

     http_communication_failure = 1

     http_invalid_state         = 2.

if sy-subrc <> 0.

   call method http_client->get_last_error

     importing

       code    = subrc

       message = errortext.

   write: / 'communication_error( send )',

          / 'code: ', subrc, 'message: ', errortext.

   exit.

endif.

call method http_client->receive

   exceptions

     http_communication_failure = 1

     http_invalid_state         = 2

     http_processing_failed     = 3.

if sy-subrc <> 0.

   call method http_client->get_last_error

     importing

       code    = subrc

       message = errortext.

   write: / 'communication_error( receive )',

          / 'code: ', subrc, 'message: ', errortext.

   exit.

endif.

The method http_client->receive always return the subrc 1 with code 110 and HTTPIO_PLG_CANCELED. Any ideas what's wrong here?

Thanks in advance

Frank-Thomas

Hello,

I want to check the existence of a specific URL from ABAP. Here is the coding

report zmmrsl_check_url.

data: http_client type ref to if_http_client

     , result      type string

     , err_string  type string

     , code        type sy-subrc

     , lv_url      type string

     , subrc       type sysubrc

     , errortext   type string

     .

call method cl_http_client=>create

  exporting host  = 'www.anycompanie.de'

    service       = '443'

     scheme        = '2'

  importing client  = http_client

  exceptions

          argument_not_found = 1

          internal_error     = 2

          plugin_not_active  = 3

          others             = 4.

* set http method GET

call method http_client->request->set_method(

   if_http_request=>co_request_method_get ).

* set request uri (/<path>[?<querystring>])

cl_http_utility=>set_request_uri( request = http_client->request

                                    uri    = 'path/anyfile.jpg' ).

call method http_client->send

   exceptions

     http_communication_failure = 1

     http_invalid_state         = 2.

if sy-subrc <> 0.

   call method http_client->get_last_error

     importing

       code    = subrc

       message = errortext.

   write: / 'communication_error( send )',

          / 'code: ', subrc, 'message: ', errortext.

   exit.

endif.

call method http_client->receive

   exceptions

     http_communication_failure = 1

     http_invalid_state         = 2

     http_processing_failed     = 3.

if sy-subrc <> 0.

   call method http_client->get_last_error

     importing

       code    = subrc

       message = errortext.

   write: / 'communication_error( receive )',

          / 'code: ', subrc, 'message: ', errortext.

   exit.

endif.

The method http_client->receive always return the subrc 1 with code 110 and HTTPIO_PLG_CANCELED. Any ideas what's wrong here?

Thanks in advance

Frank-Thomas

1 REPLY 1
Read only

Former Member
0 Likes
617

First you need to enable HTTPS on your AS ABAP, see the attached link for documentation on how to do exactly that. Then install the SSL certificate (in case of a chained certificate, all parts of it) of the web site you are trying to connect to in transaction STRUST.

http://help.sap.com/saphelp_nw73ehp1/helpdata/en/49/23501ebf5a1902e10000000a42189c/frameset.htm