Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X
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
Are you able to successfully do the POST with something like Postman?
If so, what does the call look like?
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.
The issue was solved with a try/catch loop to handle (gracefully ignore) the exception.