Support Article
Inbound map error for Rest service parsing JSON request
SA-25744
Summary
User is on Pega 7.1.6 and they have a REST service that parses JSON.
When attempting to execute the REST service, Pega throws exception 'Inbound data mapping failed'. They were attempting to parse a JSON request as shown below:
{ "traceId" : "Test" }
Error Messages
REST service [RESTServicePackageJson][REST][RESTServiceJson] failed:Inbound data mapping failed
Steps to Reproduce
- Create Rest service using HTTP Post method.
- Configure Service-REST request tab with JSON mapping
- Map the request to Clipboard Page.
- Run Service-REST, pass JSON input and check the log for errors.
Root Cause
An issue in the custom application code or rules is identified as root cause of the issue. For the JSON request, user was passing the actual property. One must pass the embedded page property in the JSON request.
Resolution
Perform the following local-change to resolve the issue:
- Add the embedded page to the JSON request used for parsing. An example is shown below:
{ "EmbededPage" : { "traceId" : "Test" } }
An example is shown below where "requestpage" and "responsepage" are configured as single page properties.
Published July 26, 2016 - 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.