I have a REST API, (let's call it MYTESTAPI1), which invokes a third party API for some data. The third-party API returns the data in the following format.
After the call, when a new sequence is invoked in the above API, it works fine.
<wd:Report_Data xmlns:wd="Project_Export">
<wd:Report_Entry>
<wd:referenceID>PR00001</wd:referenceID>
<wd:projectName>
Test Project1
</wd:projectName>
<wd:Inactive>0</wd:Inactive>
<wd:Cost_Center_group>
<wd:Cost_Center_ID>CG1</wd:Cost_Center_ID>
</wd:Cost_Center_group>
<wd:Research_Budget_Remaining>0</wd:Research_Budget_Remaining>
<wd:Currency wd:Descriptor="AUD">
<wd:ID wd:type="WID">8a96ee707a264afe888d90ef93253305</wd:ID>
<wd:ID wd:type="Currency_ID">AUD</wd:ID>
<wd:ID wd:type="Currency_Numeric_Code">036</wd:ID>
</wd:Currency>
</wd:Report_Entry>
</wd:Report_Data>
But, when I call the MYTESTAPI1 REST API, from another proxy service(which is in a different CAR file), then it gives the following exception. Any help would be really helpful. If I return the result without passing to the sequence, then it does not give an error.
[2020-02-10 18:00:39,229] ERROR {org.apache.synapse.transport.passthru.util.RelayUtils} - Error while building Passthrough stream org.apache.axiom.soap.SOAPProcessingException: First Element must contain the local name, Envelope , but found Report_Data
at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.constructNode(StAXSOAPModelBuilder.java:305)
at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.createOMElement(StAXSOAPModelBuilder.java:252)
at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.createNextOMElement(StAXSOAPModelBuilder.java:234)
at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:249)
at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.getSOAPEnvelope(StAXSOAPModelBuilder.java:204)
at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.<init>(StAXSOAPModelBuilder.java:154)
at org.apache.axiom.om.impl.AbstractOMMetaFactory.createStAXSOAPModelBuilder(AbstractOMMetaFactory.java:73)
at org.apache.axiom.om.impl.AbstractOMMetaFactory.createSOAPModelBuilder(AbstractOMMetaFactory.java:79)
at org.apache.axiom.om.OMXMLBuilderFactory.createSOAPModelBuilder(OMXMLBuilderFactory.java:196)
at org.apache.axis2.builder.SOAPBuilder.processDocument(SOAPBuilder.java:65)
at org.apache.synapse.transport.passthru.util.DeferredMessageBuilder.getDocument(DeferredMessageBuilder.java:153)