Skip to content

Instantly share code, notes, and snippets.

@nadeesha5814
Created April 12, 2015 17:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nadeesha5814/4f2ab72c1ade0a06384d to your computer and use it in GitHub Desktop.
Save nadeesha5814/4f2ab72c1ade0a06384d to your computer and use it in GitHub Desktop.
<proxy xmlns="http://ws.apache.org/ns/synapse"
name="testProxy"
transports="https,http"
statistics="disable"
trace="disable"
startOnLoad="true">
<target>
<inSequence>
<log level="full"/>
<log>
<property xmlns:m0="http://ws.apache.org/commons/ns/payload"
name="payload"
expression="$body/m0:text"/>
</log>
<property xmlns:m0="http://ws.apache.org/commons/ns/payload"
name="payload"
expression="$body/m0:text"/>
<script language="js">var payload= mc.getProperty('payload').trim();var newPayload= payload.replace("send by","from");mc.setProperty("newPayload",newPayload);</script>
<enrich>
<source type="property" clone="true" property="newPayload"/>
<target type="body"/>
</enrich>
<log level="full"/>
</inSequence>
<outSequence>
<send/>
</outSequence>
<endpoint>
<address uri="http://localhost/testEP"/>
</endpoint>
</target>
<description/>
</proxy>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment