Skip to Content
author's profile photo Former Member
Former Member

Need to call a WebService URL from PI

Hi Experts,

I need to call a WebService URL from PI. URL is of form http://ABC.com/request/request?string=getResult

I just need to call this URL. Iwill not pass any payload to it. Just calling this URL will return me result which I need to post to RFC.

What adapter should I use for this purpose (HTTP or SOAP). I get a msg from RFC, but I just need to call the URL http://ABC.com/request/request?string=getResult (without sending any payload) and will get a response, which I need to send back to RFC.

Note: I tried using SOAP adapter by populating the URL with http://ABC.com/request/request?string=getResult, but its not working. Can I use HTTP adapter (what should I provide under service no?)

Thanks,

Rakesh

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

6 Answers

  • Best Answer
    Posted on Apr 19, 2012 at 01:39 PM

    Hi,

    Same scenario is described by @Michal Krawczyk in one of his blogs here: http://scn.sap.com/community/pi-and-soa-middleware/blog/2012/01/05/michals-pi-tips-exchange-rates-from-an-xml-file-on-a-web-page--rest-axis. You just specify the interval on which the URL should be called, and you can use the response in any possible way you need.

    Hope this helps,

    Greg

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Apr 19, 2012 at 01:50 PM

    your case seems to be more of a HTTP request. Did you try with the HTTP receiver adapter?

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Apr 19, 2012 at 01:58 PM

    >Just calling this URL will return me result which I need to post to RFC.

    That means you need HTTP Get operation. If you use pI 7.3 version then http adapter supports this. Otherwise you have to follow michal blog's to achieve this using soap axis adapter.

    Note: Currently the problem is we need to know what version of axis jar needs to be deployed in sda file to achieve this. See Aaron's problem on this blog. If we use axis 1.4 jar, we get HTTPGetter class not found error. Just want to check with Michal and Aaron's reply on this topic.

    Java Proxy is another possible approach to call webservice and get the result.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Apr 19, 2012 at 02:32 PM

    Hi Rakesh

    Like Grzegorz correct me in this forum http://scn.sap.com/thread/3163691 about the same issue is not possible to use the http receiver because this adapter doesn't retrieve any payload .

    You could try better with the Grzegorz option, or try with the SOAP adapter with the mark "Don't use SOAP Envelope", or with a direct calling from a JAVA mapping or ABAP mapping in Async scenario.

    Regards.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 19, 2012 at 05:51 PM

    Hi Experts,

    Thanks to all for your quick response. Unfortunately I cannot use approach suggested in Michal's blog. Because I am getting a RFC, I am preparing the URL from it, something of form: http://ABC.com/request/request?string=<field1>+<field2>. Fields field1 and field2 will be retrieved from RFC. Hence I cannot use the approach of calling the URL from SOAP AXIS adapter.

    Can anybody suggest me the approach of doing this using Java proxy.

    Thanks,

    Rakesh

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 19, 2012 at 07:51 PM

    Hi Greg,

    I have already done that. But it not working. Let me explain my complete scenario. I have to call the Oanda webservice for currency conversion. I need to call the URL:

    This URL opens well in browser and gives me the response. I simulated it in RFC-->PI-->SOAP scenario. I took the input from RFC constructed the URL and set the same in TServerLocation attribute (used for SOAP URL) of dynamic configuration. I have also set the ASMA attributed in SOAP rcv adapter But I am getting an error in Trace saying that the URL is too long. I tried limiting the URL, but still I got an error:

    com.sap.engine.interfaces.messaging.api.exception.MessagingException: java.io.IOException: No SOAP Envelope but 1 {}ERROR; HTTP 200 OK

    I Checked the "Do not use SOAP envelope". But got an error:

    Runtime exception occurred during application mapping com/sap/xi/tf/_MM_Res_To_Res_; com.sap.aii.mappingtool.tf7.IllegalInstanceException: Cannot create target element /RESPONSE.

    Hence I want to know any other approach of calling the entire URL.

    Can anyone suggest me the Java proxy approach of calling URL:

    I can do by using the URLConnection class in UDF. But I don't want to use it because it will make the support task dificult.

    Thanks,

    Rakesh

    Add a comment
    10|10000 characters needed characters exceeded

    • Thanks a lot for your reply..

      As you suggested, i am going ahead to use SOAP Axis sender(Async) ---->ECC(FTP receiver)

      When i open this URL in browser i got the below response.

      https://www.oanda.com/rates/api/v1/rates/INR.xml?api_key=xxxxxxxxxx&decimal_places=5&date=2015-11-16&field…

      i am confused how to use the fields.

      Can i use the above URL?

      Do i have to create the fields based on the below response structure?

      <response>

      <base_currency> INR </base_currency>

      <meta>

      <effective_params>

      <data_set> oanda </data_set>

      <date>2015-11-16</date>

      <decimal_places>5</decimal_places>

      <fields>

      <field> averages </field>

      </fields>

      <quote_currencies>

      <currency> ADP </currency>

      </quote_currencies>

      </effective_params>

      <request_time>2015-11-17T08:43:16+0000</request_time>

      <skipped_currencies></skipped_currencies>

      </meta>

      <quotes>

      <quote>

      <ask> 2.35382 </ask>

      <bid>2.34773</bid>

      <currency>ADP</currency>

      <date>2015-11-16T21:00:00+0000</date>

      </quote>

      </quotes>

      </response>

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.