Skip to main content
1-Visitor
February 6, 2016
Question

Resources["ContentLoaderFunctions"].PostXML status 204 NullPointerException

  • February 6, 2016
  • 2 replies
  • 2228 views

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

2 replies

22-Sapphire I
February 9, 2016

Are you able to successfully do the POST with something like Postman?

If so, what does the call look like?

1-Visitor
February 9, 2016

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.

1-Visitor
April 28, 2016

The issue was solved with a try/catch loop to handle (gracefully ignore) the exception.