cancel
Showing results for 
Search instead for 
Did you mean: 

HTTP Get in PI 7.3

Former Member
0 Kudos

Hi All,

My scenario is ABAP Proxy to HTTP GET synchronous. I have configured my scenario an I am able to get my response in the ABAP Proxy. Now I need to add some parameters in the HTTP Url, I tried to add these parameters in the path field but I don't think it is appending it to the url because same search criteria when I run in Fiddler I get the desired records but not in SAP PI.

GET URL: https://test.abchost.com/api/invoices?created-at[gt_or_eq]=01-01-2012&exported=false

Configuration in ID:

TargetHost: test.abchost.com

TargetPort:443

Path: /api/invoices?created-at[gt_or_eq]=01-01-2012&exported=false

Can I pass these two parameters in the ASMA Url parameters ? Does Url Parameters accept boolean values( true/ false)

Thx in advance

Ravijeet

Accepted Solutions (0)

Answers (1)

Answers (1)

baskar_gopalakrishnan2
Active Contributor
0 Kudos

>Can I pass these two parameters in the ASMA Url parameters ? Does Url Parameters accept boolean values( true/ false)

There is no harm in passing query string as key value pairs. The value I believe might be only in string type not boolean.

Former Member
0 Kudos

Hi Bhaskar,

When I use this URL in Fiddler I get say 10 records.

But when I use the same url in SAP PI I get 200 records. PI does not contain the filtered data:

It's like I am getting the result from : GET URL: https://test.abchost.com/api/invoices without the filtering criteria: ?created-atgt_or_eq=01-01-2012&exported=false

Thx in advance

Ravijeet

markangelo_dihiansan
Active Contributor
0 Kudos

Hello,

It's like I am getting the result from : GET URL: https://test.abchost.com/api/invoices without the filtering criteria: ?created-atgt_or_eq=01-01-2012&exported=false

Can you try using this


%3Fcreated-atgt_or_eq%3D01-01-2012%26exported%3Dfalse

Maybe you just need to encode the URL escape characters in your URL

http://www.december.com/html/spec/esccodes.html

Hope this helps,

Mark

Former Member
0 Kudos

Hi Mark,

I tried with your suggestion but the target system threw a HTTP Bad Request

I tried https://test.abchost.com/api/invoices?exported=false, it doesn't work but if I try the date condition only it works

https://test.abchost.com/api/invoices?created-atgt_or_eq%3D01-01-2012

Whereas if I try the above condition in tools like Fiddler or Rest Desktop tools it works fine.

Also going forward if I don't want to harcode the value in the Communication channel path but use it in Dynamic Configuration in CC tick ASMA and then under apply URL parameters your entry should be like this:

Parameter1 exported

Parameter2 created-at

How do you put this condition created-at[gt_or_eq]=01-01-2012. The actual date and boolean value( true/ false) I will pass from source ABAP Proxy.

Do we have to ensure any code page or encoding format to achieve this ?

Also my target HTTP REST wenbservice has asked SAP PI to pass these values in HTTP Header which I am setting already, does the application/xml create any issues in sender URL?

X-TEST-API-KEY- 8827348ryueijefjri8r

ACCEPT - application/xml

Where can I see the actual HTTP GET url which gets constructed in the Receiver HTTP channel ?

Thx in advance

Ravijeet

markangelo_dihiansan
Active Contributor
0 Kudos

Hello,

I tried https://test.abchost.com/api/invoices?exported=false, it doesn't work but if I try the date condition only it works

https://test.abchost.com/api/invoices?created-atgt_or_eq%3D01-01-2012

There is an option in the HTTP Receiver called Mask URL Escaping, were you able to check it?

Where can I see the actual HTTP GET url which gets constructed in the Receiver HTTP channel ?

Since you are using dynamic configuration, this should be available in sxi_monitor -> double-click the message -> soap header -> dynamic configuration

Hope this helps,

Mark