cancel
Showing results for 
Search instead for 
Did you mean: 

HTTP Receiver empty payload URL only

former_member214137
Participant
0 Kudos

Hi All,

I need to create a URL to call out to Oanda to get exchange rates and the response returns the required data in XML.

Based on the query builder the vendor supplies on the line the URL would be similar to: https://www.oanda.com/rates/api/v1/rates/AUD.xml?xxxxxxx&decimal_places=5&date=2014-09-16&fields=ave...

The parameters would be built from values passed via XML payload from ECC; I found this discussion that looks like it will help me here.

Is it possible to use the HTTP receiver adapter to send a URL with no body?

If so could someone kindly point me in the right direction as to how to do this and if not what approach should I take?

Thanks in Advance

Julian

Accepted Solutions (1)

Accepted Solutions (1)

JaySchwendemann
Active Contributor
0 Kudos

Hi Julian,

which version of PI are you on? Dual Stack or AEX?

If AEX take a look at the helpfile Configuring the Java HTTP Adapter on the Receiver Channel - Advanced Adapter Engine - SAP Library Figures 18 - 20, may also apply for Dual Stack

Also you may have a look at this notes:

http://service.sap.com/sap/support/notes/1742088

https://service.sap.com/sap/support/notes/1105368

HTH

Cheers

Jens

former_member214137
Participant
0 Kudos

Hi Jens,

Thanks for the reply and recommendations.

We are on 7.1 SP1 dual stack.

thanks

Julian

JaySchwendemann
Active Contributor
0 Kudos

Please be aware that 7.11 does not support HTTP GET. However, many times the service you are calling would accept either GET or POST. However, depending on the service. You may want to try

If you must use HTTP GET you will probably need to do some extra work, try this for starts http://scn.sap.com/message/14581328#14581328

and http://scn.sap.com/people/amol.joshi2/blog/2006/06/28/must-fire-a-http-get-from-xi---try-this

Cheers

Jens

former_member214137
Participant
0 Kudos

Hi Jens,

Thanks for the suggestions.

I am pretty sure that I can call the service without the GET as it would appear from vendors test query builder that the following would work:

https://www.oanda.com/rates/api/v1/rates/AUD.xml?xxxxxxx&decimal_places=5&date=2014-09-16&fields=ave...


My issue is that I do not want to send an xml payload with the call but want to map the values sent from proxy to manipulate the URL. Mapping the URL I do not need help with.

Thanks for you time and effort helping me.

Julian

JaySchwendemann
Active Contributor
0 Kudos

Hi Julian,

ok, so am I understanding you correctly..

1. that you want to use payload data from your request to set up URL query parameters for call to target?

2. you don't want to send any xml payload in your HTTP POST to the target?

If so: Is requirement 2 a must or a can. If it would be ok to send data then simply

A:) go on as already suggested here http://scn.sap.com/message/15386220#15386220

B:) If it is not ok, to send data then you may want to try this http://scn.sap.com/thread/3185693

BTW using HTTP Post would probably not allow the usage of URL query parameters. I missed that in my previous posts so you probably will want to opt for the solution B

Cheers

markangelo_dihiansan
Active Contributor
0 Kudos

Hi,

Adding a few comments:


BTW using HTTP Post would probably not allow the usage of URL query parameters. I missed that in my previous posts so you probably will want to opt for the solution B

Interesting, but it should be allowed e.g in an SM59 type H or type G, the query string can be added by pressing save and when the warning comes, just press enter

Things to consider:

- There is a limit in dynamic configuration for URL that only allows up to 200 characters in case the full path is too long.

- If you use SOAP Adapter + ASMA to build the URL, you also need to use TAuthKey for username/password authentication (it is a bug)

Hope this helps,

Mark

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Julian,

Just wondering if you had any success with this? We just started looking into the same scenario.

We are still in PI 7.0.  Were you able to post with empty payload?

former_member214137
Participant
0 Kudos

Hi Lasya,

Not yet. Been on leave and now working on Personas 3.0 project. Will get back to this issue November sometime.

If you come up with a solution before then, how about documenting your solution for others to leverage off. I will do the same if you have not already.

All the best

Julian

Former Member
0 Kudos

Sure, will do that. My timeline is also similar, so looks like we will be working in parallel. Also , we are still at PI 7.0 , so options are limited some what.

Former Member
0 Kudos

You can use ASMA for your dynamic URL.

Use mapping and call below UDF for your requirement.

String URL = "http://server/access/query?svcid=1962021057&username=User&password=Pass&elems=1321&key1="+phoneNumber+"&key1900=none";

DynamicConfiguration conf = (DynamicConfiguration)container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);

DynamicConfigurationKey key= DynamicConfigurationKey.create("http://sap.com/xi/XI/System/HTTP","TargetURL");

  1. conf.put(key,URL);

return "";

sunilchandra007
Active Contributor
0 Kudos

In addition to Jens's suggestion, you can also check the OS command like wget/curl as explained in .

Regards,

Sunil Chandra