REST Connector Query Preview results in “unexpected character encountered while parsing value: <”
                    
                
                
                    
                        book
                        
Article ID: KB0077612
                        
                    
                    
                        calendar_today
                        
Updated On: 
                    
                 
                
                
                
                    
                
                    
                    
                    
                    
                        
                            
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.                       
    When the web service is run and tested in Postman, a header is configured:   
   Key = Accept        Value = application/json  
                          
    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.  
                        
 
                     
                    
                    
                    
                    
                        
                            
                                
Resolution
                            
                            
                                  To resolve this error, configure a Custom Header in the REST Connector connection:   
   - Edit the REST Connection
    - Select the Custom Headers tab
    - Click + to create a new Custom Header
    - Enter the header name and value
   
                       
      For additional information, see the following in the TIBCO Scribe® Online Help:    
TIBCO Scribe® Online Connector For REST Web Services  
                             
                         
                        
                    
                        
                            
                                
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.
                            
                         
                        
                    
                    
                    
                
                    
                        
                            Was this article helpful?
                        
                        
                            
                                thumb_up
                                Yes
                            
                            
                                thumb_down
                                No