PureConnect

 View Only
Discussion Thread View
  • 1.  JSON Parser Error

    Posted 08-21-2019 11:37
    Hello All,

    Need some help with "JSON Parser" tool-step in the handlers.
    I am passing a string containing JSON output from "REST HTTP Request" tool-step to the "JSON Parser" tool-step but it errors out and takes the JSON Parse Failure path.
    Looking at ip.log, I can see the following error;

    JSONParser() : Failed to parse JSON:
    ErrorCode: error.i3json.reader
    Description: [line 1, pos 0]: Cannot read a value past the end

    I am not sure what the issue is and why it is failing as the JSON string looks good to me, something like;
    {"Auth_Status_Final":"Verified","Broker_Provider":"XXX","CorpID":"NoValue","ABC":"123456789","DEF":"01d802e384032795"}

    Any help would be appreciated.

    Regards
    #Handlers

    ------------------------------
    Vineet Kakroo
    FIL Investment Management Ltd
    ------------------------------


  • 2.  RE: JSON Parser Error

    Posted 08-21-2019 11:48
    Any chance the returned value has a trailing comma?  This is one thing I know will cause a parse error with that toolstep.

    Otherwise I would debug your handler and look at the output of the rest request to check for syntax errors.

    ------------------------------
    Aaron Lael
    State of Utah
    ------------------------------



  • 3.  RE: JSON Parser Error

    Posted 08-21-2019 11:52
    Thanks Aaron.
    Yes I have already debugged the handler and there is no apparent error nor a trailing comma.#Will continue to debug anyway.

    Regards

    ------------------------------
    Vineet Kakroo
    FIL Investment Management Ltd
    ------------------------------



  • 4.  RE: JSON Parser Error

    Posted 08-22-2019 12:30
    I ran your JSON through this and it passed, can you post the complete json and the status code? I used to get a lot of 400 errors that is because I was missing some values. Try to put an event log to capture the responsebody and it might give you some more detail on what is going on.

    ------------------------------
    Sheldon Breading-Goodrich
    Financial Engines, Inc.
    ------------------------------



  • 5.  RE: JSON Parser Error

    Posted 08-23-2019 03:10
    Hi Sheldon,

    I have managed to fix it. Problem was malformed JSON. One of the handlers was adding an invalid character and that was causing it. Had to run a few handlers in debug to figure out which one was the culprit.

    Regards

    ------------------------------
    Vineet Kakroo
    FIL Investment Management Ltd
    ------------------------------



Need Help finding something?

Check out the Genesys Knowledge Network - your all-in-one access point for Genesys resources