REST Connector Query Preview results in “unexpected character encountered while parsing value: <”

REST Connector Query Preview results in “unexpected character encountered while parsing value: <”

book

Article ID: KB0077612

calendar_today

Updated On:

Products Versions
TIBCO Cloud Integration - Connect ( Scribe ) -

Description

The web service for this scenario can return a response in either JSON or XML.  The TIBCO Scribe® Online Connector for REST Web Services requires the response in JSON format.
 
                 User-added image

When the web service is run and tested in Postman, a header is configured:
Key = Accept        Value = application/json

                      User-added image

In TIBCO Scribe® Online, the REST Connection tests successfully, but a Query block preview in a map results in the following error:
 
ERROR: Exception Type: JsonReaderException 
Message: Unexpected character encountered while parsing value: <. Path ", line0, position 0.

A Fiddler trace indicates the web service response is XML format, not JSON format.

Issue/Introduction

The error “Exception Type: JsonReaderException, Message: Unexpected character encountered while parsing value: <. Path ", line0, position 0.” can be resolved by configuring a Custom Header on the REST connection to specify application/json.

Resolution

To resolve this error, configure a Custom Header in the REST Connector connection:
  1. Edit the REST Connection
  2. Select the Custom Headers tab
  3. Click + to create a new Custom Header
  4. Enter the header name and value
                     User-added image


For additional information, see the following in the TIBCO Scribe® Online Help:   TIBCO Scribe® Online Connector For REST Web Services