Skip to Content
0

Issue with receiver REST adapter for '=' character, how to escape special character in REST URL

May 04 at 06:25 PM

193

avatar image
Former Member

Hi Experts,

I need to call the REST api by POST method with the dynamic url from PO. No payload required to pass.

In the URL, one of the parameters value has the special character '=' in it. PI REST recevier channel is not doing the url encoding for that character. its a base64 format so '=' is always coming at the end.

This is the final url used to call REST api (POST) which is a Bad request (look at the '=' at the end)

https://xxxxxx.com?Action=xxxxx&SignatureMethod=xxxxx&SignatureVersion=2&Timestamp=2018-05-03T20%3A23%3A06Z&Version=2009-01-01&Signature=q4F03DLHlARtTPbPuMF9qM4vheAo%2BPo4V%2FhxVClqHm4=

If i do the url encoding in the mapping and passing it to REST receiver channel, then the adapter is doing automatic encoding on top it which is not correct. As per SAP documentation, REST adapter does the automatic url encoding.

I should do either the below,

1. Do the url encoding in the mapping and stop the REST adapter from automatic encoding (stopping automatic encoding)

2. A workaround to escape the encoding character at the channel level. I will encode the '=' as %3D in my mapping and pass it to channel, but channel should not encode '%' character on top of it, means it should not convert %3D to %253D again (actual encoding for % is %25)

Please share your thoughts on this.

Thanks in advance.

Stephen Rouvier

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
avatar image
Former Member May 09 at 06:22 PM
1

Hi Stephen,

Check SAP Notes 2215187, it has a module parameter EncodeURL , set it to true/false based on your requirement.

Regards

Amith Bhumu

Show 1 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Hey Amith,

Thanks for the reply. Wow! This is solved my problem. :)

As the solution1, I did URL encoding in the mapping and used module parameter to stop automatic encoding.

Thanks,

Stephen Rouvier

0
Hemant Chahal May 04 at 09:15 PM
0

Hi Stephen,

Try using HTTP channel and dynamic URL parameters and it should work.

Warm Regards

Hemant Chahal

Share
10 |10000 characters needed characters left characters exceeded