Skip to Content

Recently I’m focused on learning about Restful Web Services.  

I think REST is much more immediate, easy and light than SOAP (however REST vs SOAP isn’t the focus of this blog).

I developed an ABAP application (ECC 6.0 NetWeaver 7.01) to call several REST services exposed by an External System.

Normally I use 2/3 great Firefox extensions to test and call REST resources in addition to Firebug.

RESTclient : https://addons.mozilla.org/it/firefox/addon/restclient/

POSTER : https://addons.mozilla.org/it/firefox/addon/poster/

FIDDLER:  http://www.fiddlertool.com/ (also Windows Version)

These extensions are really helpfull, we can use them, for example, to send post  request, set basic authentication, add header fields and so on but suppose that in our scenario we can’t use this extensions due to network policies because our local IP can’t reach Http service.

Suppose also that only SAP host’s is configured to reach the url via Http port 80.

I began to create a custom report client “zutil_http_client” as i can’t use Fiddler/Poster but after several test code I found the standard program RSICFCLTST01.

 

RSICFCLTST01 is a great tool based on cl_http_client, a test framework similar to RESTclient/Fiddler .

 After run, the program show the following screen. In tab Session, we create the destination (by Url or by Http Destination)

image

 

On tab Detail we can set request fields, method type or other characteristics using IF_HTTP_REQUEST methods.
In subtabs Detail -> Request -> Methods I’ve set the value Rome for parameter wheater

image

 

At any time we can see our request switching to tab Detail -> Request -> Text


image

 

After that we call method SEND and RECEIVE on tab Detail -> Request -> Methods and then view the response in the appropriate tab.

 

image

I think it would be useful in future to have a  tab JSON, however on tab Detail -> Request we can call all IF_HTTP_RESPONSE methods.

To report this post you need to login first.

11 Comments

You must be Logged on to comment or reply to a post.

    1. Alessandro Spadoni Post author
      Thanks John, this is my first blog on Sdn Community.

      If you use Firebug , the JSON Tab allows to see the Json Response as tree for exploring Data.

      I hope to find an Abap Class JSON parser in next Enhancement Package 🙂

      (0) 
      1. John Patterson
        Alessandro
        Great first blog.

        Did a quick look on my 7.02 system and found a couple of simple JSON serializer’s in the delivered code. A JSON explorer like in Firebug (thanks for pointing it out) would be cool.
        Cheers
        JSP 

        (0) 
  1. Sivaganesh K

    Hi,

    Great Blog.. 🙂 .. I worked with your document.. It was helpful. I tried executing webservice through the reports it works great.. I just have a doudt on how to post the value to webservice through this report ? If i have a xml data to be passed to webservice how its possible to send through this.. ?

    Regards,

    Sivaganesh

    (0) 
    1. Alessandro Spadoni Post author

      Thank you!

      this is my first blog in SCN..I’m glad that an old blog is still useful 🙂

      If you need to post data you have to change the HTTP Method (it’s “GET” by default”) going to Detail -> Request -> Methods -> SET_METHOD method

      setMethod.JPG

      then you can past your XML data calling the REQ_SET_CDATA method (but I didn’t tried)

      (0) 
  2. Meichun Lane

    Hi Alessandro,

    Thank you for sharing. I was trying to replicate what you did but I don’t see any results populated in the Response – HTML container. Can you please provide some guidance?

    After I Sent the request:

    HTTPClient1.png

    The results in Response – Text:

    HTTPClient2.png

    The results in Response – HTML:

    HTTPClient3.png

    (0) 
    1. Alessandro Spadoni Post author

      Hi Meichun,

      I suppose the google API weather is deprecated…you can try with another link/Rest service,

      I’ll try to update asap the blog with another example

      (0) 

Leave a Reply