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

Re: What is the need of creating & Consuming the web services ?

$
0
0

The following example is for a web service that accepts an HTTP GET with a three-parameter query string.  If you want to consume a SOAP web service, put the WSDL document in the generator in SE80 to build a proxy function.

 

DATA: webclient TYPE REF TO if_http_client,

      results TYPE string.

 

cl_http_client=>create(

  EXPORTING host = 'mydotnetserver.com'

  IMPORTING client = webclient ).

 

webclient->request->set_method(

  if_http_request=>co_request_method_get ).

 

cl_http_utility=>set_request_uri(

  request = webclient->request

  uri = '?param1=value1&param2=value2&param3=value3' ).

 

webclient->send( ).

webclient->receive( ).

 

results = webclient->response->get_cdata( ).

* Now you can parse the results

 

webclient->close( ).

 

You will most likely need to build a dynamic uri, so make sure and escape your parameter values using cl_http_utility=>if_http_utility~escape_url( ).  I hope this helps.  Let me know if you have any questions!

 

Best,

Eric


Viewing all articles
Browse latest Browse all 1056

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>