URL Changed between test and Running

URL Changed between test and Running

  

I have put a REST service into my Outsystems application.  It looks similar to this:

http://MyServer.MyCompany.net/RestService.svc/OrderedTests()?%24filter=AccessionNumber%20eq%20%27{AccNum}%27

I test it and it works perfectly! (in the REST test window)

But when I run, I get a 400 bad request error.  Looking at the logs, it is using this URL

http://MyServer.MyCompany.net/RestService.svc/OrderedTests()?%24filter=18339460015

For some reason it takes out the text "AccessionNumber" that should be right after 'filter='.  

Why would it do that, and how can I stop it from doing that?

I am using Outsystems 10

Hi Stephen,

Can you please let us know some more details about your issue?
-Are you consuming and exposing REST services from your environment?
-What is the data type of your variable 'AccessionNumber'
-Is 'AccessionNumber' a mandatory parameter in your service?

Regards,
Palak Patel

Stephen Schaff wrote:

I have put a REST service into my Outsystems application.  It looks similar to this:

http://MyServer.MyCompany.net/RestService.svc/OrderedTests()?%24filter=AccessionNumber%20eq%20%27{AccNum}%27

I test it and it works perfectly! (in the REST test window)

But when I run, I get a 400 bad request error.  Looking at the logs, it is using this URL

http://MyServer.MyCompany.net/RestService.svc/OrderedTests()?%24filter=18339460015

For some reason it takes out the text "AccessionNumber" that should be right after 'filter='.  

Why would it do that, and how can I stop it from doing that?

I am using Outsystems 10

Check the Log, Ref Below Link to know more about API Logs:

https://www.outsystems.com/forums/discussion/33272/setting-logging-level-of-a-rest-api/


Palak Patel wrote:

Hi Stephen,

Can you please let us know some more details about your issue?
-Are you consuming and exposing REST services from your environment?
-What is the data type of your variable 'AccessionNumber'
-Is 'AccessionNumber' a mandatory parameter in your service?

Regards,
Palak Patel

>> Are you consuming and exposing REST services from your environment?

I am only consuming the REST service.  It is an in-house REST service, not created by OutSystems.

>> What is the data type of your variable 'AccessionNumber'

Text

>> Is 'AccessionNumber' a mandatory parameter in your service?

The actual REST service does not need the parameter, but the way I have built it in OutSystems is that it is mandatory.

assif_tiger wrote:

Stephen Schaff wrote:

I have put a REST service into my Outsystems application.  It looks similar to this:

http://MyServer.MyCompany.net/RestService.svc/OrderedTests()?%24filter=AccessionNumber%20eq%20%27{AccNum}%27

I test it and it works perfectly! (in the REST test window)

But when I run, I get a 400 bad request error.  Looking at the logs, it is using this URL

http://MyServer.MyCompany.net/RestService.svc/OrderedTests()?%24filter=18339460015

For some reason it takes out the text "AccessionNumber" that should be right after 'filter='.  

Why would it do that, and how can I stop it from doing that?

I am using Outsystems 10

Check the Log, Ref Below Link to know more about API Logs:

https://www.outsystems.com/forums/discussion/33272/setting-logging-level-of-a-rest-api/


Unfortunatly, I have already checked the log.  By turning the log level all the way up, I was able to see the URL that OutSystems was calling.  That is how I found that it had removed part of the URL.  (The part with the parameter name.)


I was able to find an ugly work around to this issue.  But I am not going to mark it as a solution as I am hoping I can get a real answer.

The workaround is to change my url to this:

http://MyServer.MyCompany.net/RestService.svc/OrderedTests()?%24filter={QueryText}

I then set the value of QueryText to:

   "AccessionNumber eq'" + Accession + "'"

When I do that I get a full, correct URL.  Still it is ugly.  So I am hopeful there is a real fix to this issue.

Hi Stephen,

Did you try to use the symbols instead of the encoding. For example %24 is $.

Check this for the others https://www.w3schools.com/tags/ref_urlencode.asp

Regards,

Marcelo

Marcelo Ferreira wrote:

Hi Stephen,

Did you try to use the symbols instead of the encoding. For example %24 is $.

Check this for the others https://www.w3schools.com/tags/ref_urlencode.asp

Regards,

Marcelo

I originally put the URL in with the actual symbols.  OutSystems changed it to the encoded values.