Salesforce Certified Application Architect

Tuesday 19 January 2016

System.XmlException: only whitespace content allowed before start tag and not { (position: START_DOCUMENT seen {... @1:1)

During writing the test class the problem is testing a method that makes a REST request, 

I have tried to implment "HttpCalloutMock" without success an am getting the following error =

"System.XmlException: only whitespace content allowed before start tag and not [ (position: START_DOCUMENT seen [... @1:1)"


Solution :  
It's like the document .getChildElement and Root element on this fake response is not valid, It might be format problem like XML or JSon .

Please pass the fake response as you require i mean you are getting fake response in your debug log is not valid response its could be format problem .

Thanks
Gaurav
 

No comments:

Post a Comment

Salesforce Certified Application Architect & Certified Data Architecture and Management Designer Exam

How to pass Salesforce Certified Data Architecture and Management Designer Exam This exam was 1st architect exam for me. Its not that muc...