JSON input stream does not start with the \"{\" character.

We are implementing REST web services. Integration Server is throwing error as shown below went we hit the flow service using JSON request
{
“$errorDump”: “com.wm.util.coder.InvalidDatatypeException: [ISC.0076.9012] Invalid state. JSON input stream does not start with the “{” character.\n\tat com.wm.util.coder.IDataJSONCoder.decode(IDataJSONCoder.java:302)\n\tat com.wm.app.b2b.server.ContentHandler_JSON.getInputValues(ContentHandler_JSON.java:40)\n\tat com.wm.app.b2b.server.HTTPInvokeHandler._process(HTTPInvokeHandler.java:148)\n\tat com.wm.app.b2b.server.RESTHandler.process(RESTHandler.java:39)\n\tat com.wm.app.b2b.server.HTTPDispatch.handleRequest(HTTPDispatch.java:174)\n\tat com.wm.app.b2b.server.Dispatch.run(Dispatch.java:383)\n\tat com.wm.util.pool.PooledThread.run(PooledThread.java:119)\n\tat java.lang.Thread.run(Thread.java:781)\n”,
“$errorInfo”: {
“$errorDump”: “com.wm.util.coder.InvalidDatatypeException: [ISC.0076.9012] Invalid state. JSON input stream does not start with the “{” character.\n\tat com.wm.util.coder.IDataJSONCoder.decode(IDataJSONCoder.java:302)\n\tat com.wm.app.b2b.server.ContentHandler_JSON.getInputValues(ContentHandler_JSON.java:40)\n\tat com.wm.app.b2b.server.HTTPInvokeHandler._process(HTTPInvokeHandler.java:148)\n\tat com.wm.app.b2b.server.RESTHandler.process(RESTHandler.java:39)\n\tat com.wm.app.b2b.server.HTTPDispatch.handleRequest(HTTPDispatch.java:174)\n\tat com.wm.app.b2b.server.Dispatch.run(Dispatch.java:383)\n\tat com.wm.util.pool.PooledThread.run(PooledThread.java:119)\n\tat java.lang.Thread.run(Thread.java:781)\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”: “eveIn:_put”,
“$user”: “Default”,
“$time”: “Fri Jul 10 08:18:43 BST 2015”
},
“$error”: “[ISC.0076.9012] Invalid state. JSON input stream does not start with the “{” character.”,
“$errorType”: “com.wm.util.coder.InvalidDatatypeException”
}

When we validate the JSON request in JSON validator, we are getting message(Valid JSON).Please find the JSON request below.

[{
“id”:“SJNFD56485215646”,
“schedDateTime”:“2015-03-04 16:37:06”,
“parkingPosition”:null,
“achievementDateTime”:“2015-04-29 11:00”
}]

Please suggest on this.

Thanks in Advance.

Regards,
Jacob B

What is the IS version you are facing this issue and assuming this is the first time you are testing REST in your env?

Also please check this Empower article and it looks like similar issue dealing:
https://empower.softwareag.com/sl24sec/SecuredServices/KCFullTextASP/viewing/view.asp?KEY=111032-3331312&DSN=PIVOTAL&DST=TCD&HL=1&QUERY=JSON|input|stream|does|not|start&SessionID=337464367

HTH,
RMG

Hi RMG,

I am using webMethods 9.5. Yes, this is the first time i have implemented REST service using JSON request.

Can you please suggest on this. Is the fix available for 9.5 version as well ?

Regards,
Jacob B

Please raise a ticket with SAG similar to 9.6 issue…hopefully some thing they can suggest you.

HTH,
RMG

Dears,

First thing these special characters comes when we don’t put in proper format while running service.
tHIS Message it seems that you are giving value to a JSON Stream which will not work.

For successful implementation.

Please find the snapshots to implement HTTP using JSON Request Call.
For pushing request use REST Client.

Note:While making setResponse2 hardcode Content-Type=‘application/json’.



Hi,

The approach which you have mentioned works when you have named document or document List input fields. Here the requirement was to accept unnamed JSON list input for which Software AG provided a fix, without which IS wont accept JSON List input.

Please see the input i have mentioned below for clear understanding of the issue.

Our issue is resolved.

Regards,
Jacob B

Jacob,

Can you please share the SAG fix name and for which IS version? Your info will help other users with similar issue path.

Is the fix part of web service stack or some eng fix was provided to you?

HTH,
RMG

Dear,

This Service will also work for the JSon List or Document.

@jacob You mentioned some input type defined below.
but it’s not there.

Hi RMG,

Name of the fix : PIE-37185_JSONRootArray_TestPatch.

IS version : 9.5

As per my understanding this is not web service stack fix. Should be some some eng fix.

@Trivedi: Below is the input structure.

[{
“id”:“SJNFD56485215646”,
“schedDateTime”:“2015-03-04 16:37:06”,
“parkingPosition”:null,
“achievementDateTime”:“2015-04-29 11:00”
}]

Regards,
Jacob B