So, i have flow service and exposing it using Rest Resource with http POST method.
How to handle if the request have empty body , not a single string?
currently the webMethods return error like this
{
"$errorDump": "com.wm.util.coder.InvalidDatatypeException: [ISC.0076.9012] Invalid state. JSON input stream does not start with the \"{\" character.\r\n\tat com.wm.util.coder.IDataJSONCoder.decode(IDataJSONCoder.java:378)\r\n\tat com.wm.app.b2b.server.ContentHandler_JSON.getInputValues(ContentHandler_JSON.java:59)\r\n\tat com.wm.app.b2b.server.HTTPInvokeHandler.getPostParams(HTTPInvokeHandler.java:623)\r\n\tat com.wm.app.b2b.server.HTTPInvokeHandler.getContentForPostAndPut(HTTPInvokeHandler.java:611)\r\n\tat com.wm.app.b2b.server.HTTPInvokeHandler._process(HTTPInvokeHandler.java:155)\r\n\tat com.wm.app.b2b.server.RESTHandlerV2.process(RESTHandlerV2.java:85)\r\n\tat com.wm.app.b2b.server.HTTPDispatch.handleRequest(HTTPDispatch.java:190)\r\n\tat com.wm.app.b2b.server.Dispatch.run(Dispatch.java:401)\r\n\tat com.wm.util.pool.PooledThread.run(PooledThread.java:134)\r\n\tat java.lang.Thread.run(Thread.java:748)\r\n",
"$errorInfo": {
"$errorDump": "com.wm.util.coder.InvalidDatatypeException: [ISC.0076.9012] Invalid state. JSON input stream does not start with the \"{\" character.\r\n\tat com.wm.util.coder.IDataJSONCoder.decode(IDataJSONCoder.java:378)\r\n\tat com.wm.app.b2b.server.ContentHandler_JSON.getInputValues(ContentHandler_JSON.java:59)\r\n\tat com.wm.app.b2b.server.HTTPInvokeHandler.getPostParams(HTTPInvokeHandler.java:623)\r\n\tat com.wm.app.b2b.server.HTTPInvokeHandler.getContentForPostAndPut(HTTPInvokeHandler.java:611)\r\n\tat com.wm.app.b2b.server.HTTPInvokeHandler._process(HTTPInvokeHandler.java:155)\r\n\tat com.wm.app.b2b.server.RESTHandlerV2.process(RESTHandlerV2.java:85)\r\n\tat com.wm.app.b2b.server.HTTPDispatch.handleRequest(HTTPDispatch.java:190)\r\n\tat com.wm.app.b2b.server.Dispatch.run(Dispatch.java:401)\r\n\tat com.wm.util.pool.PooledThread.run(PooledThread.java:134)\r\n\tat java.lang.Thread.run(Thread.java:748)\r\n",
"$error": "[ISC.0076.9012] Invalid state. JSON input stream does not start with the \"{\" character.",
"$localizedError": "[ISC.0076.9012] Invalid state. JSON input stream does not start with the \"{\" character.",
"$errorType": "com.wm.util.coder.InvalidDatatypeException",
"$service": "apiSprintIS.services:new_flowservice",
"$user": "52125",
"$time": "Mon Mar 02 15:09:05 ICT 2020"
},
"$error": "[ISC.0076.9012] Invalid state. JSON input stream does not start with the \"{\" character.",
"$errorType": "com.wm.util.coder.InvalidDatatypeException"
}
Thankyou