Quantcast
Channel: SCN: Message List - Service-Oriented Architecture (SOA) and SAP
Viewing all articles
Browse latest Browse all 1056

Re: Configure web service + logical port

$
0
0

A good way of checking the connection between the SAP Box and the target Service Box is to use the CL_HTTP_CLIENT class. This basically acts like a browser / web explorer from the SAP Box itself.

 

Using that client you can prove that SAP can at least see the service it's supposed to be communicating with...

Viewing the content of the "return" variable in the HTML viewer can yield interesting results....

 

lv_url = 'http://blah-blah-blah/EventLog.asmx'.

 

 

* Create Client

   call method cl_http_client=>create_by_url

     exporting

       url    = lv_url

     importing

       client = http_client.

 

* Send

   call method http_client->send

     exceptions

       http_communication_failure = 1

       http_invalid_state         = 2.

 

* Receive

   call method http_client->receive

     exceptions

       http_communication_failure = 1

       http_invalid_state         = 2

       http_processing_failed     = 3.

   if sy-subrc ne 0.

     http_client->response->get_status(

       importing

         code   = lv_ret_code

         reason = lv_err_string

            ).

     message lv_err_string type 'I'.

   endif.

 

* Now we have the response , parse , display

* do what you like

   return = http_client->response->get_cdata( ).

 

   write: return.


Viewing all articles
Browse latest Browse all 1056

Trending Articles