IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
Expand all | Collapse all

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

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

    Posted Mon July 13, 2015 10:41 AM

    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


    #Integration-Server-and-ESB
    #webMethods


  • 2.  RE: JSON input stream does not start with the \"{\" character.

    Posted Mon July 13, 2015 12:37 PM

    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


    #webMethods
    #Integration-Server-and-ESB


  • 3.  RE: JSON input stream does not start with the \"{\" character.

    Posted Mon July 13, 2015 12:41 PM

    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


    #webMethods
    #Integration-Server-and-ESB


  • 4.  RE: JSON input stream does not start with the \"{\" character.

    Posted Mon July 13, 2015 04:42 PM

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

    HTH,
    RMG


    #Integration-Server-and-ESB
    #webMethods


  • 5.  RE: JSON input stream does not start with the \"{\" character.

    Posted Tue May 17, 2016 07:00 AM

    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’.




    #Integration-Server-and-ESB
    #webMethods


  • 6.  RE: JSON input stream does not start with the \"{\" character.

    Posted Tue May 17, 2016 07:40 AM

    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


    #webMethods
    #Integration-Server-and-ESB


  • 7.  RE: JSON input stream does not start with the \"{\" character.

    Posted Tue May 17, 2016 11:45 AM

    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


    #webMethods
    #Integration-Server-and-ESB


  • 8.  RE: JSON input stream does not start with the \"{\" character.

    Posted Tue May 17, 2016 03:11 PM

    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.


    #Integration-Server-and-ESB
    #webMethods


  • 9.  RE: JSON input stream does not start with the \"{\" character.

    Posted Wed May 18, 2016 03:54 AM

    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


    #webMethods
    #Integration-Server-and-ESB