Resources["ContentLoaderFunctions"].PostXML status 204 NullPointerException
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Resources["ContentLoaderFunctions"].PostXML status 204 NullPointerException
Hi,
I need to call a REST webservice what response with status 204. If I test my thing's service what is calling the remote API the Resources["ContentLoaderFunctions"].PostXML causes Wrapped java.lang.NullPointerException Cause: null
Is this because the response must not include content when status 204 is returned whilst PostXML expects content? Is there any workaround?
Best regards
Christian
- Labels:
-
Connectivity
- Tags:
- rest api
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Are you able to successfully do the POST with something like Postman?
If so, what does the call look like?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I have no issues with Postman, here is post request:
POST /v2/devices/00:11:22:33:44:55/configurations.xml?componentId=com.eurotech.framework.protocol.pcn2.impl.PcnServiceImpl HTTP/1.1
Host: api-sandbox.everyware-cloud.com
Authorization: Basic ZYXwvtsrqponmLKJIHgfedcba012345678904223
Content-Type: application/xml
Cache-Control: no-cache
Postman-Token: +++++++-++++-++++-++++-++++++++++++
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<esf:configurations>
...// xml to post
</esf:configurations>
and response:
204 No Content
I can pm you the original request, if needed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
The issue was solved with a try/catch loop to handle (gracefully ignore) the exception.
