Unable to call the Get method because query Params contains special Characters.

Hi,

I am unable to call the Get method in http client because it contains special characters in query params and i am getting below error.

Error: java.io.IOException: Illegal character in query at index 128:

Get URL : http://tech.forums.softwareag.com:9999/test_T3Server/api/v2/SDA/testmanagment?$format=json&$top=25&$filter=((testType eq ‘Temporary Repair’) and (testUpdatedDateTime ge 2018-10-31T06:00:00%2B00:00 and testDateTime le 2018-11-01T12:00:00%2B00:00))&$count=true

Please suggest.

Thanks,
Lohit

Try URL Encode, check the service pub.string:URLEncode for more details.

Hi Mahesh,

Thanks for there reply.

I tried encoding the URL before invoking the http client with encoded URL but now i am getting error like “(The filename, directory name, or volume label syntax is incorrect)”

Please suggest.

Did you try invoking the same url on a soap ui or rest client? Do you get the success response?

Hi Mahesh,

yes i tried invoking the api endpoint through postman and it is working fine and getting successful response as well.

Thanks,
Lohit

Strange!

The error does not give me more details. Check the below points and verify

– Check the connectivity between your IS and API endpoint via telnet/ping
– Increase IS logging and trying hitting the API endpoint from IS, capture the logs
– Try a some simple url and see if you are able to connect

Also, share your IS version and fix levels.

Hi Mahesh,

I tried increasing the logging level but nothing is working for me.

Also It is failing when calling the URL with complete filter condition but when i am passing filter condition partially then it is working fine (Complete URL is working in Postman).

Failed: http://tech.forums.softwareag.com:9999/test_T3Server/api/v2/SDA/te...son&$top=25&$filter=((testType eq ‘Temporary Repair’) and (testUpdatedDateTime ge 2018-10-31T06:00:00%2B00:00 and testDateTime le 2018-11-01T12:00:00%2B00:00))&$count=true

Passed: http://tech.forums.softwareag.com:9999/test_T3Server/api/v2/SDA/te...son&$top=25&$filter=((testType eq ‘Temporary Repair’))&$count=true

Also i am using 10.1 version of designer.

Thanks,
Lohit

Hi Mahesh,

I found the issue and the issue was with the URL: (Postman automatically taking care of the encoding)

http://tech.forums.softwareag.com:9999/test_T3Server/api/v2/SDA/te...son&$top=25&$filter=((testType eq ‘Temporary Repair’) and (testUpdatedDateTime ge 2018-10-31T06:00:00%2B00:00 and testDateTime le 2018-11-01T12:00:00%2B00:00
))&$count=true

Actually the workstream team encoded some part of the URL (12:00:00%2B00:00) and it was throwing the error. So i changed the URL like below

http://tech.forums.softwareag.com:9999/test_T3Server/api/v2/SDA/te...son&$top=25&$filter=((testType eq ‘Temporary Repair’) and (testUpdatedDateTime ge 2018-10-31T06:00:00+00:00 and testDateTime le 2018-11-01T12:00:00+00:00
))&$count=true

Thanks,
Lohit