Quantcast
Channel: SCN : All Content - ABAP Development
Viewing all articles
Browse latest Browse all 8332

Unable to connect https url

$
0
0

Hi  experts,

 

Iam trying to connect with https url  but raising exception communication failure while calling method  http_client->receive.

 

iam using below code.

 

CALL METHOD cl_http_client=>create
   EXPORTING
     host               = 'https://XXXX.aspx'
     service            = '443'
*    proxy_host         =
*    proxy_service      =
     scheme             =  '2'
*    ssl_id             =
*    sap_username       =
*    sap_client         =
   IMPORTING
     client             = http_client
   EXCEPTIONS
     argument_not_found = 1
     plugin_not_active  = 2
     internal_error     = 3
     others             = 4
         .
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

 

     http_client->request->set_header_field( name = 'Authkey'
                                value = 'ZmV4dFIz' ).

 

CALL METHOD http_client->request->set_cdata
     EXPORTING
       data = w_string.

 

CALL METHOD http_client->send
     EXCEPTIONS
       http_communication_failure = 1
       http_invalid_state         = 2.

 

 

     CALL METHOD http_client->receive
       EXCEPTIONS
         http_communication_failure = 1
         http_invalid_state         = 2
         http_processing_failed     = 3.


Viewing all articles
Browse latest Browse all 8332

Trending Articles