URL Rewriting
Requires version 1.3.0 or above.
Membrane Monitor/Router can change the path URI of a request. A request to
http://router.predic8.com/blz-service?wsdl
can be rewritten to
http://thomas-bayer.com/axis/services/BLZService?wsdl
The hostname is changed by the routing rule. To change the path URI you have to use an interceptor. Membrane comes with a SimpleURLRewriteInterceptor that can do the modification.
SimpleURLRewriteInterceptor
To demonstrate how the interceptor works the following steps describe how to map the WSDL of the BLZService to a nicer URL.
Open the file:
MEMBRANE_INSTALL_DIR/configuration/monitor-beans.xml
There you find a configuration of the SimpleURLRewritingInterceptor.
<bean id="urlRewriter" class="com.predic8.membrane.core.interceptor.rewrite.SimpleURLRewriteInterceptor">
<property name="displayName" value="Simple URL Rewriter" />
<property name="mapping">
<map>
<entry>
<key>
<value>/blz-service?wsdl</value>
</key>
<value>/axis2/services/BLZService?wsdl</value>
</entry>
</map>
</property>
</bean>
You can specify as many mappings as you want. The key is the path URI of the request and the value is the path URI you want your request to be sent to. First, we have to associate the interceptor with a routing rule. Start Membrane Monitor and create a Simple Reverse Proxy Rule.

Figure 1:
Specify 2000 as the port number on which the router will listen.

Figure 2:
Than specify thomas-bayer.com as target host and 80 as target port. Next click on Finish.

Figure 3:
To add the interceptor rightclick on the newly created rule in the Rule View and choose edit. Click onto the Interceptors tab and than on Add.

Figure 4:
On the Add New Interceptor dialog choose Simple URL Rewriter and click on Ok. Simple URL Rewriter is the display name of the interceptor we have just configured in the XML file.

Figure 5:
Now you can see the Simple URL Rewriter in the list of the engaged interceptors for this rule.

Figure 6:
Test the monitor by opening the URL http://localhost:2000/blz-service?wsdl in your browser. You should get the WSDL from the BLZ service.

Figure 7:
