‎2012 Jun 14 2:10 AM
G'day all,
I'm having an issue calling a URL which contains duplicate parameters because CL_HTTP_CLIENT is stripping out the duplicates.
The URI is in the form like:
?&action="CREATE"&type="Project"&id="MA-00178"&actype="Vendor"&acid="0000100020"&actype="ProjectAppropriation"&acid="MA00178"
When the request leaves SAP it's in form:
?&action="CREATE"&type="Project"&id="MA-00178"&actype="ProjectAppropriation"&acid="MA00178"
I've debugged down to a level within the class where the parameters are taken from the URI and formatted into a table of name value pairs and is then passed down to a C level routine which I can only assume deletes duplicates from the table before reconstructing the URI.
Is there anyway to prevent this?
Many thanks,
Mark
‎2013 Jun 18 6:57 AM
Did you ever get to the bottom of this? I think I have debugged into the same bit of code and can see a system-call that seems to overwrite any duplicate/subsequent URL query parameters with the first value.
I can't seem to find a general agreement in "HTTP Land" how duplicate query parameters should be handled but there is a discussion here: http://stackoverflow.com/questions/1746507/authoritative-position-of-duplicate-http-get-query-keys
Cheers,
Simon
‎2013 Jun 18 8:07 AM
G'day Simon,
Unfortunately the detail of this is lost is a client email system, but in the end I believe the solution was to ensure that parameter names were unique. I was in the fortunate position of designing both sides of the solution and so could work around the limitation.
Given the stripping happens down in C you can't do much other than request SAP's help. Given the variety of responses in your link I can imagine that SAP may do it on purpose 'to be safe' or 'consistent' - i.e. regardless of the receiving system the solution will work consistently, unfortunately consistently with duplicates removed.
Good luck,
Mark
‎2013 Jun 18 11:11 AM
I was in the fortunate position of designing both sides of the solutionFirst of all I would change the request from a GET to a POST, because you want to "CREATE" something.
This would also have the advantage, that you can fill the request body with whatever you want (XML, JSON, plain text), even dublicate parameters.
‎2013 Jun 18 5:11 PM
There is a note about duplicate parameters being overwritten, see SAP note 1856171.