Forum Discussion

jyotishman22's avatar
jyotishman22
Occasional Contributor
14 years ago

Disable URL-Encoding of the parameter value for MATRIX param

Hi,
Selecting the "Disable URL-Encoding of the parameter value" box for MATRIX parameters of a REST service does not stop soapUI from encoding the parameters. However when I change the parameter style to "QUERY" instead of "MATRIX" the parameters aren't encoded as expected. Could you please take a look at this issue? I am using soapUI Pro 4.0.1.

Thanks,
Jyo
  • Hi,

    ok thanks for this - I see what is going on now - as a temporary workaround could you try selecting the "Preencoded Endpoints" option in the Global Preferences HTTP Settings tab!?

    regards!

    /Ole
    SmartBear Software
  • Hi,

    unfortunately I can't reproduce this with the current nightly build - could you attach or send us your project file containing a REST Request with a matrix parameter and its value that is not handled correctly?

    thanks in advance!

    regards,

    /Ole
    SmartBear Software
  • jyotishman22's avatar
    jyotishman22
    Occasional Contributor
    Hi,
    I have attached a sample project here. I am using "google.com" as the service end point for the request as an example of a valid server. As you will see I have selected "Disable URL Encoding" for the "URL" parameter. I have already encoded the parameter as "http:%2F%2Fwww.eviware.com%2Fforum%2F" and do not want this to be URL encoded. However when I send the request, the parameter gets encoded.

    The output from the http log is captured below:
    Tue Nov 15 12:18:37 EST 2011:DEBUG:<< " <p>The requested URL <code>/rest/test;RESULT=SUCCESS; URL=http:%252F%252Fwww.eviware.com%252Fforum%252F</code> was not found on this server. <ins>That[0xe2][0x80][0x99]s all we know.</ins>[\n]"
    Tue Nov 15 12:35:03 EST 2011:DEBUG:>> "GET /rest/test;RESULT=SUCCESS;URL=http:%252F%252Fwww.eviware.com%252Fforum%252F HTTP/1.1[\r][\n]"

    The URL has been encoded to: "http:%252F%252Fwww.eviware.com%252Fforum%252F".

    When I change the "Style" of the parameter from MATRIX to QUERY, and select the "Disable URL Encoding" option, the parameter isn't encoded as expected. The output from the http log for this case is captured below:

    Tue Nov 15 12:48:44 EST 2011:DEBUG:<< " <p>The requested URL <code>/rest/test;RESULT=SUCCESS?URL=http:%"
    Tue Nov 15 12:48:44 EST 2011:DEBUG:<< "2F%2Fwww.eviware.com%2Fforum%2F</code> was not found on this server. <ins>That[0xe2][0x80][0x99]s all we know.</ins>[\n]"
    Tue Nov 15 12:49:26 EST 2011:DEBUG:>> "GET /rest/test;RESULT=SUCCESS?URL=http:%2F%2Fwww.eviware.com%2Fforum%2F HTTP/1.1[\r][\n]"

    Thanks,
    Jyo
  • jyotishman22's avatar
    jyotishman22
    Occasional Contributor
    Hi,
    I have already tried using that option, but it does not have any effect. I have included the output below:

    Wed Nov 16 09:17:41 EST 2011:DEBUG:<< " <p>The requested URL <code>/rest/test;RESULT=SUCCESS;URL=http:%252F%252Fwww.eviware.com%252Fforum%252F</code> was not found on this server. <ins>That[0xe2][0x80][0x99]s all we know.</ins>[\n]"
    Wed Nov 16 09:18:56 EST 2011:DEBUG:>> "GET /rest/test;RESULT=SUCCESS;URL=http:%252F%252Fwww.eviware.com%252Fforum%252F HTTP/1.1[\r][\n]"

    As you can see, the URL is still encoded to "http:%252F%252Fwww.eviware.com%252Fforum%252F".

    Thanks,
    Jyo
  • Hi Jyo,

    strange, that worked for me as a workaround. In that case I wonder if you could work around the issue by specifying the value of the parameter as a standard property (TestCase, Properties Step, etc..) and then expanding it in the URL using standard property expansion!?

    Does that make sense?

    regards!

    /Ole
    SmartBear Software
  • jyotishman22's avatar
    jyotishman22
    Occasional Contributor
    Hi,
    I have attached a sample project using the steps you suggested as a temporary workaround. As you will see I am using http://www.google.com/rest/test;URL=${URL} as the service end point and I have setup a URL property in the previous step to substitute the value into the endpoint. I have already encoded the value as "http:%2F%2Fwww.eviware.com%2Fforum%2F" and selected the "Preencoded Endpoints" option in the Global Preferences HTTP Settings tab. I have included the output from the output from the http log below:

    Thu Nov 17 10:49:49 EST 2011:DEBUG:>> "PUT /rest/test;URL=http:%252F%252Fwww.eviware.com%252Fforum%252F HTTP/1.1[\r][\n]"

    As you can see the '%' is still being encoded to '%25'.

    Thanks,
    Jyo
  • jyotishman22's avatar
    jyotishman22
    Occasional Contributor
    Hi,
    Sorry, I just realized that I had actually forgotten to attach the sample project. It is attached here.

    Thanks,
    Jyo
  • Hi

    ok, thanks - I've reported this as a bug internally - I'm very sorry for the inconvenience so far.

    regards!

    /Ole
    SmartBear Software