Demonstrate the ability of the URL rewrite mediator to perform rewrites based on multiple rules
One may specify multiple rewrite rules for a URL rewrite mediator instance. In that case Synapse will execute all the rules on each message, in the order they appear. This particular sample lists 3 rewrite rules. To try it out, invoke the client as follows.
The provided address URL does not contain a port number and the context. The URL rewrite mediator will replace the hostname (test.com) with 'localhost' and add the context '/services' to the path. Then it will add the appropriate port number to the URL by looking at the protocol prefix. Ultimately the service request will be routed the sample Axis2 server and the client will receive a valid response.
Another important aspect shown by this sample is the ability of the URL rewirte mediator to obtain the necessary values by executing XPath expressions. The port numbers are calculated by executing an XPath on the messages.