Skip to content

Instantly share code, notes, and snippets.

@imesh
Created August 27, 2014 16:21
Show Gist options
  • Save imesh/12a081b8432fefb53b68 to your computer and use it in GitHub Desktop.
Save imesh/12a081b8432fefb53b68 to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
name="echoProxy"
transports="https,http"
statistics="disable"
trace="disable"
startOnLoad="true">
<target>
<inSequence>
<property name="URL" value="http://host:8280?p1=abc&amp;p2=qwe"/>
<filter source="$ctx:URL" regex=".*format=.*">
<then>
<property name="URL_UPDATED"
expression="replace($ctx:URL, 'format=([^&amp;]*)', 'format=xml')"/>
</then>
<else>
<property name="URL_UPDATED" expression="concat($ctx:URL, '&amp;format=xml')"/>
</else>
</filter>
<log level="custom">
<property name="-- original --" expression="$ctx:URL"/>
<property name="-- updated --" expression="$ctx:URL_UPDATED"/>
</log>
<send>
<endpoint>
<address uri="http://localhost:8280/services/echo"/>
</endpoint>
</send>
</inSequence>
<outSequence>
<send/>
</outSequence>
</target>
<publishWSDL uri="http://localhost:8280/services/echo?wsdl"/>
<description/>
</proxy>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment