Forum Discussion

ECiurleoIOP's avatar
ECiurleoIOP
Occasional Contributor
8 years ago

SoapUI CE and ReadyAPI (SoapUI NG) encode URLs differently.

I have created an HTTP request to the URL below in SoapUI and SoapUI Pro NG

http://localhost:8888/content-service/content/book?query=(collection="IOP Concise Physics") 

 

However, the encoding of the URL sent appears to differ between the two.  It looks like SoapUI is encoding the quotes to %20 and %22 respectively.

 

In SoapUI Pro NG it seems to be encoding the URL twice, converting the % to %25 followed by the 22, resulting in %2522

 

Why do the free edition and the paid edition have different encoding behaviours?

 

Sent using SoapUI Pro NG

 

 

GET http://localhost:8888/content-service/content/book?query=(collection=%2522IOP%20Concise%20Physics%2522) HTTP/1.1
Accept-Encoding: gzip,deflate
Host: localhost:8888
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.5.2 (Java/1.8.0_112)

Sent using SoapUI 

 

GET http://localhost:8888/content-service/content/book?query=(collection=%22IOP%20Concise%20Physics%22) HTTP/1.1
Accept-Encoding: gzip,deflate
Host: localhost:8888
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)

I have tried disabling URL encoding and putting in %20 or %22 but this results in the reverse behaviour occurring.

    • ECiurleoIOP's avatar
      ECiurleoIOP
      Occasional Contributor

      It appears that a REST GET is encoded differently from a HTTP GET.

       

      ALthough I contacted support, they were not able to provide me with a reason for this functional difference 

  • Hi,

    Did you found a solution, I know it's an old problem, but I still have it.
    I switch from SOAPUI 5.4.0 to ReadyApi 2.4.0. I run a HTTP request 

    https://toto.com/query?coco=["tata"."titi"]

    On SOAP UI I have this raw 

    GET https://toto.com/query?coco=%5B%22tata%22.%22titi%22%5D HTTP/1.1
    Accept-Encoding: gzip,deflate
    User-Agent: Apache-HttpClient/4.1.1
    Authorization: Token 64xQimpBfVWirqSnK2J7
    Host:toto.com
    Connection: Keep-Alive

    Now with ReadyAPI I have

    GET https://toto.com/query?coco=%5B%2522tata%2522.%2522titi%2522%5D HTTP/1.1
    Accept-Encoding: gzip,deflate
    User-Agent: Apache-HttpClient/4.1.1
    Authorization: Token 64xQimpBfVWirqSnK2J7
    Content-Length: 0
    Host:toto.com
    Connection: Keep-Alive

    It seems that we have a double encoding of the double quote.

     

    I try to encode manually the request and click on "Preferences" > "HTTP" > "Pre-encoded endpoints : URL contains encoded endpoints ,....." to don't have a double encoding. With Ready API this option works. With SOAP UI this option doesn' t work.

     

    So my question is there a solution to make my script works with SOAPUI and ReadyApi?

     

    Thank you

    • nmrao's avatar
      nmrao
      Champion Level 3
      Can you please clarify what happens when you hit the pre-encoded url from SoapUI CE? Does it throw any error? Is the request sent out is correct? Does it reach to the server?
  • Thank you for your response.

    The 2 requests hit the server.

    If I request https://toto.com/query?coco=["tata"."titi"]  with SOAP UI all characters are well encoded and I have a the response I expect. 

    If I request https://toto.com/query?coco=["tata"."titi"]  with ReadyApi the double quote is "double encoded"  and my service responds an error (which is normal) . I guess the point is, the double quotes is encoded a first time (%22) and I don't know why but the percent is a second time encoded (%25) the result is the double quote is now encoded like %2522.

    • richie's avatar
      richie
      Community Hero

      niherbreteau

       

      I can't help at all - but I'm grateful you provided a work around for this - I might stumble across this in future - so I'm very grateful! (I'm using ReadyAPI!)

       

      cheers,

       

      richie

    • nmrao's avatar
      nmrao
      Champion Level 3
      If I understand it right, SoapUI CE is working as desired, but not ReadyAPI. Correct?
      Report the case with Customer support using https://support.smartbear.com

      Mean while, may be you can give it a try if you have earlier version to see if that helps.

      Otherwise, try the below workaround to see if that helps.
      Create a test case level custom property, and provide that value as needed and use the Property expansion in the URL to see if that helps.

      By the way, are you using both the softwares (CE and Pro)? or just trying it on CE as Pro did not work?