Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

The URLRewrite Mediator (New in version 4.0) is used to modify and transform the URL values available in the message.

...

Table of Contents
maxLevel3
minLevel3
locationtop
styleborder:1
locationtop
typeflat
separatorpipe

...

UI Configuration

...

Specify the following properties:

  • In Property - By default, the Rewrite Mediator will take the "To" header of the message and will apply the provided rewrite rules on it. If the user specify a specifies an inPorperty attribute, the mediator will take the value of the specified property as the input URL.
  • Out Property - Similarly, the mediator by default sets the transformed URL as the "To" header of the message. Alternatively, user users can use the outProperty attribute to instruct the mediator to set the resulting URL as a property.

The Rewrite Mediator applies URL transformations by evaluating a set of rules on the message. To add a rule to the mediator, click on the "Add Rule" link.

In the appeared window which appears, specify the following options:

  • Condition - A rule can consist of have an optional condition. If the condition is provided, it will be evaluated first.
  • Action - It states which what type of an action should be executed on the URL. This defaults to "set" value.
  • Fragment - This attribute can be used to specify the URL fragment on which the action should be executed.
  • Option
  • Value/Expression - The value to values "set," "append" or "prepend" must be specified using either the "value" attribute or the XPath attribute. One of these two attributes is always needed unless the value of the "type" attribute is set to "remove."
  • Regex - When user users set action to "replace," an additional "regex" attribute must be specified, which indicates the portion that should be replaced with the given value.
  • Delete - Allows to remove the action.

Example

Code Block
XML
XML
<rewrite>
	<rewriterule>
		<action type="replace" regex="soap" value="services" fragment="path" />
	</rewriterule>
</rewrite>

...

The address URL of the request contains the context "soap." In the ESB server, all the services are deployed under a context named "services" by default. So, the "To" header will be re-written by replacing the "soap" context with "services." Hence, the requests will be delivered to the server successfully.

...