Skip to main content

This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.

Support Article

Error on parsing REST Response

SA-37432

Summary



Calling a JSON REST service using Connect-Rest Rule. GET method works fine but PUT fails with error.


Error Messages



PegaRULES log shows:
HTTP Status code: 400 Bad Request

Tracer shows:

pyRawMessage
Unexpected character ('<' (code 60)): expected a valid value (number, String, array, object, 'true', 'false' or 'null') at [Source: org.jboss.resteasy.core.interception.MessageBodyReaderContextImpl$InputStreamWrapper@171476a8; line: 1, column: 2]

pyStatusValue Fail:
Unexpected HTTP 400 Response code

pyStatusMessage
the HTTP response code of 400 indicated a client error. The response data may contain a reason.

pyHTTPResponseCode
400


Steps to Reproduce

  1. Call a Rest service that returns JSON response
  2. Use Put method and try to map the response


Root Cause



A software use or operation error. Tracer output shows pyRequestData or "Request Message" in XML format which means JSON conversion of request Clipboard page hasn't been done. The default format used by Pega for mapping outbound Rest request is XML and not JSON. Since the end Rest Service expects a JSON message, it returns 400 Bad request error.


Resolution



Perform the following local-change: On Request tab of Put method of Connect-Rest Rule form, specify JSON as 'Map From'.

Published May 6, 2017 - Updated October 8, 2020

Was this useful?

0% found this useful

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice
Contact us