Support Article
Error parsing response from REST service
SA-33260
Summary
The user is on Pega 7.2.1 and is not able to parse a REST response from the Service:
Error Messages
com.pega.pegarules.pub.services.InboundMappingException: Error mapping incoming response to .response_POST: org.codehaus.jackson.JsonParseException: Unexpected character ('' (code 65279 / 0xfeff)): expected a valid value (number, String, array, object, 'true', 'false' or 'null') at [Source: java.io.StringReader@5fbf866e; line: 1, column: 2]
or
** Error mapping incoming response to .response_POST: org.codehaus.jackson.JsonParseException: Unexpected character ('' (code 65279 / 0xfeff)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')
at [Source: java.io.StringReader@19a6e597; line: 1, column: 2]
Steps to Reproduce
- Create a REST connector.
- Use POST method for calling the Service.
- Invoke the REST connector from an activity. We can see the connector failing while parsing the response received from the Service.
Root Cause
A defect or configuration issue in the operating environment is identified as root cause. The REST service is sending an additional dot prepended to the JSON response. Due to this reason the JSON response is not confirming to the JSON standard and Pega is failing to parse the message received from the REST service.
Resolution
Make the following change to the operating environment:
- Contact the team owning the REST Service to rectify the JSON response sent by the webservice to Pega.
Published February 3, 2017 - Updated October 8, 2020
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.