Forum Discussion

aleksey's avatar
13 years ago

'(' and ')' characters in request url

Hello All,

I have a web service that provides some information by the following url: /object/objectusage?filter=objectId(EQ)<objectId>
In general the requested url looks like <server_ip>/object/objectusage?filter=objectId(EQ)12345, in this case it returns the information about the object with "12345" id. This request returns correct data when I execute it in the browser (Firefox or Chrome).
In soapUI I created the resourse for this url, the request has one parameter ("filter") and this parameter has "objectId(EQ)12345" value.

The problem is that when I run this request, the response comes with 500 status (500 Server Error). Unfortunately I have no access to the server logs, so I can't see what exactly happens in this case. As I can see on "Raw" tab SoapUI perfroms the following request:
GET http://<server_ip>/object/objectusage?filter=objectId%28EQ%2912345 HTTP/1.1
'(' and ')' characters are escaped by the appropriate character codes. The same request in the browser returns correct data.
In similar case where a parameter after "(EQ)" condition is a string parameter, the request returns correct data.

Did you face with the problem with escaping of '(' or ')' characters in your urls?
Could you give any ideas how to make my request correct?

1 Reply

  • ankyeez's avatar
    ankyeez
    Occasional Contributor
    Hello Buddy,

    You need to encode the symbol ( to %28 and ) to %29 to send it to URL. It simply means you need to write %28 in place of ( whereever you are using it to send it to the URL.

    You can find the encoding values for other symbols here
    http://www.w3schools.com/tags/ref_urlencode.asp

    Cheers,
    aNkyEEz - The Keys to Success!