I'm creating a sequence in WSO2 Api Manager which needs to receive a request A, transform this request to B and send it to a service S1. When response comes I need to update some elements of the original request based on the response body and send it to the service S2.
I was trying to build such sequence, and I'm almost there. The only problem I have is the 2nd part: my headers are lost and they are not passed to the S2 (but they are passed to S1). How can preserve headers in this second call, or maybe I'm doing something incorrectly?
orignial RQ -> build a new RQ -> send to S1 -> enrich the original RQ -> send to S2
<sequence name="CustomSequence" trace="disable" xmlns="http://ws.apache.org/ns/synapse">
<property expression="json-eval($.)" name="Message" scope="default" type="STRING"/>
<class description="MyCustomMediator" name="com.sample.MyCustomMediator"/>
<payloadFactory description="MyRequestUpdater" media-type="json">
<format>$1</format>
<args>
<arg evaluator="xml" expression="get-property('MY_SECRET_DATA')"/>
</args>
</payloadFactory>
<call>
<endpoint>
<http method="post" trace="disable" uri-template="https://<url to service S1>"/>
</endpoint>
</call>
<property expression="json-eval($.)" name="ResponseFromS1" scope="default" type="STRING"/>
<class description="MyCustomMediator2" name="com.sample.MyCustomMediator2"/>
<send>
<endpoint>
<http trace="disable" uri-template="http://<url to service S2>"/>
</endpoint>
</send>
</sequence>