We have a API end point that has a GET method and takes in parameters P1, P2, P3 etc....We have a requirement to sort the parameters in the input query string alphabetically and then set their corresponding values against it. For eg : Input url is https:// host:port/email=V1&coupon=V2&include=V3&channel=v4 We want to take the query string part of url and arrange it to a string like below channel=v4&coupon=V2&email=V1&include=V3 Can the above be done using a set of assertions and put within a policy fragment.Overall aim is to get the resulting string ( parameters arranged alphabetically ) and generate hash key out of that, then route to an end point that requires the hash key to be submitted in the header for authentication.
As far as sorting your inbound Params, you should be able to use something like this (also attached)
this takes the inbound query params, loads it into an xml doc, then sorts via XSLT, then coverts it back to a string that can be used for the Next call to the backend.
Im also assuming your input is like this:
Thanks a lot for the idea, trying it now and trying to put it in as a policy fragment.
Yes, you are correct, the input is :