URL rewrite mediator can be used to modify the 'To' header of a request based on one or more user defined URL rewrite rules. A rewrite rule could be a plain rewrite instruction or a conditional instruction. In this sample we use a plain, unconidtional rewrite rule which simply replaces the string 'soap' with 'services' in the 'To' header.
Invoke the sample client as follows to try this out.
Note that the address URL of the client request contains the context 'soap'. But in the Axis2 server all the services are deployed under a context named 'services' by default. Synapse will rewrite the To header of the request by replacing the 'soap' context with 'services. Hence the request will be delivered to the Axis2 server and the Axis2 client will receive a valid response.