The Property Mediator has no direct impact on the message, but rather on the message context flowing through Synapse. The properties set on a message can be later retrieved through the synapse:get-property(prop-name)
XPath extension function. If a scope is specified for a property, the property could be set as a transport header property or an (underlying) Axis2 message context property, or as a Axis2 client option. If a scope is not specified, it will default to the Synapse message context scope. Using the property element with action specified as remove
you can remove any existing message context properties.
...
Table of Contents | ||||
---|---|---|---|---|
|
...
|
...
Some Well-defined Properties that you can Get/Set on the Synapse Message Context Scope
...
The get-property()
function allows any XPath expression used in a configuration to look-up information from the current message context. It is possible to retrieve properties previously set with the property mediator, and/or information from the Synapse or Axis2 message contexts or transport header. The function accepts the scope as an optional parameter as shown below:
Code Block |
---|
synapse:get-property( [(axis2 | axis2-client | transport),] <property_name> [,<dateformat>] )
|
...
Name | Meaning |
---|---|
body | The SOAP 1.1 or 1.2 body element. For example, |
header | The SOAP 1.1 or 1.2 header element. For example, |
ctx | Prefix for Synapse MessageContext properties. For example, |
axis2 | Prefix for Axis2 MessageContext properties. For example, |
trp | Prefix for the transport headers. For example, |
...
Syntax
Code Block |
---|
<property name="string" [action=set|remove] (value="literal" | expression="xpath") [scope=transport|axis2|axis2-client]/>
|
...
Info | ||
---|---|---|
| ||
You can click this link to add namespaces if you are providing an expression. You will be provided another panel named "Namespace Editor," where you can provide any number of namespace prefixes and URL that you have used in the XPath expression. See Common Screens and Dialog Boxes. |
- Type - Specifies the type of the property. Property mediator will handle the property as a property of selected type. Possible values are:
- STRING
- INTEGER
- BOOLEAN
- DOUBLE
- FLOAT
- LONG
- SHORT
OM
Info title Tip In default property mediator will consider any property as a STRING type property.
- Value/Expression
- Pattern - Specifies a regular expression that will evaluate against value of the property or result of the XPath expression.
- Group - Number (Index) of the matching item evaluated using regular expression given in "Pattern."
- Scope - Specifies the scope the property is valid. Possible values are:
- Synapse
- Transport
- Axis2
- axis2-client
...
In this example, we are setting the property symbol and later we are logging it using the Log Mediator.
Excerpt | ||
---|---|---|
| ||
Description of the Property Mediator in WSO2 ESB. |