REST Consumer URL param is not working, but TEST ok

Hi there,

I experienced a strange behavior. I used the parameter in URL to consume REST and tested it OK. Or when I removed the params, it's good.

I paginated the response because it was too big. As you can see above, it was OK.


However, when I tried to consume this inside the Client action, it's not working (it will fetch all data, hence causing errors because the XML response was too large)


Error:


Don't know what's happening :( Thanks for all your help!


I need to pass params and fetch all data by changing the skp param.


Regards,

I do not have the exact number on top of my head, but there are limitations of size on each response, data type fields, on database columns etc.

You may use the component FactoryConfiguration to adjust the server properties e.g. maxAllowedContentLength in your case.

Hi,


The problem is not about the configuration. The error is shown because 2 params not working. So, it will fetch all large amounts of data. Actually, it's normal. I did a normal GET request (not by OutSystems) and it showed me the same error.


What I'm curious about is why it's not working, but it's OK when I tested it (as you can see in the first attached image).

And if I removed 2 params, and put 10 and 0 directly in the URL, it's OK.


Thanks,


Solution

Hi Minh,

Did you increase the logging level of the REST API, and see what exactly is sent?

Solution

Hi Kilian,


Thanks for your hint. Here is the log URL:

https://ceva....8u4dttij5hdcuxhsmbtp8&options=10

The URL's param was not correctly replaced.


The original URL was: 

https://ceva....8u4dttij5hdcuxhsmbtp8&options=num-{num}.skp-{skp}


What I expected: 

https://ceva....8u4dttij5hdcuxhsmbtp8&options=num-10.skp-0


Thanks,


It seems the "num" is missing? The URLs all have "options=10", not "options=num-10" or the like. How did you define these parameters in Service Studio?

Hi Kilian,


In the original post, 2nd image, I showed how I called this API and passed the params into it.

You can refer back to the image.


Thanks,

Hi,


I see what happened. The issue came from the format after options param:

&options=num-{num}.skp-{skp}

The REST API param followed Swagger format, so it will replace everything after options param at once

=> &options=10 (10 will replace num-{num}.skp-{skp})


How to fix: I changed the param to &options={options} and pass options as string with "num-{num}.skp-{skp}".


Thanks all!



HI Minh ,

I hope your problem is solved and Killians answer helped you , please go ahead and mark the suitable answer as solution to stop further attention on this post.


Regards,

-PJ-

Hi Minh,

I would think this is a bug, so be sure to report it to OutSystems Support as well. But good that you found a workaround. Happy coding!