Skip to content

Instantly share code, notes, and snippets.

@hasithaa
Created September 21, 2014 12:16
Show Gist options
  • Save hasithaa/db00d16542dd74ddfbaa to your computer and use it in GitHub Desktop.
Save hasithaa/db00d16542dd74ddfbaa 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="EchoUTBasicProxy"
transports="https,http"
statistics="disable"
trace="disable"
startOnLoad="true">
<target>
<inSequence>
<log level="custom" separator="," description="Log">
<property name="Proxy" value="EchoUTWithBasicAuthProxy"/>
</log>
<property name="user_name" value="bob" scope="default" type="STRING"/>
<property xmlns:ns="http://org.apache.synapse/xsd"
name="Authorization"
expression="fn:concat('Basic ', base64Encode(fn:concat(get-property('user_name'),':','bobpass')))"
scope="transport"
type="STRING"/>
<log level="custom">
<property name="Generated Authorization token" expression="$trp:Authorization"/>
</log>
<send>
<endpoint>
<address uri="https://localhost:9443/services/echo"/>
</endpoint>
</send>
</inSequence>
<outSequence>
<log level="full"/>
<header xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
name="wsse:Security"
scope="default"
action="remove"/>
<send/>
</outSequence>
<faultSequence/>
</target>
<publishWSDL uri="http://localhost:9763/services/echo?wsdl"/>
<description/>
</proxy>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment