cancel
Showing results for 
Search instead for 
Did you mean: 

Error while receiving response from Salesforce - REST API

dichaudhuri
Explorer
0 Kudos

Hi,

There is a requirement where i need to consume the REST API of Salesforce and send the data. The asynchronous communication is working perfectly but while getting back the response, i am getting the below error :-

RuntimeException during appliction Java mapping com/sap/xi/tf/_MessageStatusSFDCResponse_to_MessageStatusSFDCResponse_
Thrown:
com.sap.aii.utilxi.misc.api.BaseRuntimeException: Content is not allowed in prolog.
at com.sap.aii.mappingtool.tf7.Transformer.checkParserException(Transformer.java:205)
at com.sap.aii.mappingtool.tf7.Transformer.start(Transformer.java:159)
at com.sap.aii.mappingtool.tf7.AMappingProgram.transform(AMappingProgram.java:686)
at com.sap.aii.ib.server.mapping.execution.JavaMapping.executeStep(JavaMapping.java:112)
at com.sap.aii.ib.server.mapping.execution.Mapping.execute(Mapping.java:60)
at com.sap.aii.ib.server.mapping.execution.MappingHandler.map(MappingHandler.java:87)
at com.sap.aii.ib.server.mapping.execution.MappingHandler.map(MappingHandler.java:71)
at com.sap.aii.ibrun.sbeans.mapping.MappingAccessBean.executeMappingSteps(MappingAccessBean.java:237)
at com.sap.aii.ibrun.sbeans.mapping.MappingAccessBea

Basically - MessageStatusSFDCResponse_to_MessageStatusSFDCResponse is my response mapping linked at the Operation mapping level.


I am using PO's REST receiver adapter and the Data Format and HTTP Headers tab detail screen shots are attached. Where am I missing out?

Accepted Solutions (1)

Accepted Solutions (1)

engswee
Active Contributor
0 Kudos

Hi Diptendu

Content not allowed in prolog error is indicative that the content is not in XML format as expected.

You have selected the response format as XML. Maybe the response is also in JSON format. Did you try this using an external tool like Postman or Chrome's Advanced REST client?

You can also add logging (using MessageLoggerBean) at the receiver channel to log the content of the payload for the response to see what you are actually receiving. With this, it will help you design your interface accordingly.

Regards

Eng Swee

dichaudhuri
Explorer
0 Kudos

Thanks Eng! - I have already set the global parameter so the message logging option is there, I also checked the Add Wrapper and added the namespaces and element name and it worked !

Thanks a bunch!

Answers (0)