Scripted Rest Service Supported request formats
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2019 05:58 AM
I created a scripted rest service and set the Supported request formats to: application/json,application/xml,text/xml. When I call the rest service with the body encoded as JSON and set the content-type header to application/json it works perfectly fine. However If I format the body as XML with a header of application/xml I receive the following error message:
Status: 500 Internal Server Error
Message: com.glide.rest.util.RESTRuntimeException: Error Parsing input streamJSONObject[\"request\"] not found.
Is a scripted rest service not able to handle multiple formats? Is there some other parameter I need to set?
Thanks,
Don
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-02-2020 02:52 PM
I realize this is 11 months old, but do you remember if you found a solution to this and what it was? This is literally the only result that shows up when I Google the error.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-02-2020 03:06 PM
Actually, I found the problem shortly after posting my reply. I had a bad property name which didn't exist in the script for the web service.
// Bad version
gs.log(request.body.data);
// Fixed version
gs.log(request.body);
I don't know yet why request.body.data isn't there, but removing .data fixed my error.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-14-2020 03:31 PM
It looks like the expected XML format must be:
<request>
<entry>
</entry>
.
.
.
</request>
I think that error is indicating the parser couldn't find the <request> element in the body.