...
Table of Contents | ||
---|---|---|
|
Using the
...
Payload Factory mediator
You can add custom SOAP headers to a request by using the PayloadFactory Mediator in the proxy service as shown in the example below.
...
Excerpt | ||
---|---|---|
| ||
This content was added for the FAQ How to add custom SOAP headers to a request?. |
Using the
...
Script mediator
You can add custom SOAP headers to a request by using the addHeader(mustUnderstand, content)
of 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> |