Forum Discussion

SpeedyPenguin's avatar
SpeedyPenguin
New Contributor
15 years ago

SoapUI 3.6.1 request params with pipe character

In SoapUI 3.6.1, when I have a test step that creates an HTTP or REST request with a parameter whose value contains pipe characters (a.k.a. vertical bar, or "|"), instead of passing the value to the server as-is, it splits the value at each pipe character and repeats the parameter that many times in the request. For example, if I specify a parameter color=brown|blue|green, then the request that gets sent to the server is http://localhost/?color=brown&color=blue&color=green. Note that the same thing happens when posting the request parameters using the "Post QueryString" checkbox. This only happens SoapUI 3.6.1, the latest release. SoapUI 3.5, 3.5.1, and 3.6 do not behave this way.

It looks like SoapUI tried to get clever and add a feature for specifying multi-valued request parameters. The problems with this implementation are that:
1) It breaks all of our current tests because we expect the "|" in the request parameter value to be passed to the server, and
2) There appears to be no workaround because if I change the characters to the URL-encoded equivalent (i.e. if I use "%A6" instead of "|" in the value), then SoapUI tries to be helpful and URL-encode the "%" character before sending the request to the server.

I've attached a small sample SoapUI project that demonstrates the described behavior. Please fix this bug or advise of a way to disable this behavior. Thank you.
  • Hi!

    thanks for reporting this; you can "escape" a pipe by adding another one, ie use '||' as a delimiter. To not break all existing tests we would need to add a global setting to disable this behavior, or what do you think?

    regards!

    /Ole
    eviware.com
  • Thanks for your response. Your suggestion of adding a global setting to disable the behavior would be ideal for us so that our existing tests can work without modification as they did in previous versions of SoapUI.

    Also, thanks for the information about being able to disable the functionality by escaping the pipe character by doubling it. I did not think to try that combination. We will keep this in mind as we maintain and modify our tests going forward.
  • jjmartin's avatar
    jjmartin
    New Contributor
    I am looking for how to do this now in v4? I saw a previous forum post saying the ability to call a rest with the same parameter twice was missing prior to 3.6. This one is from smoeone haveing a problem and not wanting to submit the parameter multiple times.

    I have tried setting my parameter to 1|2|3 but its just getting url encoded...

    How do i submit values so a parameter with the same name is shown multiple times?
  • jjmartin's avatar
    jjmartin
    New Contributor
    i am able to get it to work by telling the request to not encode the value and just add additional values manually in the form:
    blue&color=red

    would result in color=blue&color=red
  • Hi,

    in 4.0 there is a "Delimiter" property for the REST request in the bottom left table of properties, set this to the regular expression that should be used to separate the values, for example \| for pipe

    Does that help?

    regards,

    /Ole
    eviware.com