cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X

Resources["ContentLoaderFunctions"].PostXML status 204 NullPointerException

christianb1
1-Newbie

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

3 REPLIES 3
PaiChung
22-Sapphire I
(To:christianb1)

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.

Top Tags