Custom SOAP headers can be added You can add custom SOAP headers using the following methods:
You can add custom SOAP headers to a request by using the PayloadFactory Mediator in the proxy service as shown in the example below.
...
You can add custom SOAP headers to a request by using the Script Mediator in the proxy service as shown in the example below.
Code Block |
---|
|
<proxy xmlns="http://ws.apache.org/ns/synapse"
name="CustomSOAPHeaderProxy"
startOnLoad="true"
statistics="disable"
trace="disable"
transports="http,https">
<target>
<inSequence>
<log level="full">
<property name="Message" value="IncomingRequest"/>
</log>
<script language="js">mc.addHeader(false, <ns:sampleCustomHeader xmlns:ns="gsb:http://wso2.org/sample"><ns:customInfo>CustomHeader</ns:customInfo></ns:sampleCustomHeader>);</script>
<log level="full">
<property name="Message" value="UpdatedMessage"/>
</log>
<drop/>
</inSequence>
</target>
<description/>
</proxy> |