Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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
maxLevel3
minLevel3

...

styleborder:1
locationtop
typeflat
separatorpipe

...

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, expression="$body/getQuote" refers to the first getQuote element in the SOAP body regardless of whether the message is SOAP-11 or SOAP-12.

header

The SOAP 1.1 or 1.2 header element. For example, expression="$header/wsa:To refers to the addressing To header regardless of whether this message is SOAP-11 or SOAP-12.

ctx

Prefix for Synapse MessageContext properties. For example, expression="$ctx:RESPONSE" gives the value of the Synapse message context property with name "RESPONSE."

axis2

Prefix for Axis2 MessageContext properties. For example, expression="$axis2:messageType" gives the value of the axis2 message context property with name "messageType."

trp

Prefix for the transport headers. For example, expression="$trp:Content-Type" gives the value of the "Content-Type" transport header, which is going to be the Content-Type of the current message.

...

Syntax

Code Block

<property name="string" [action=set|remove] (value="literal" | expression="xpath") [scope=transport|axis2|axis2-client]/>

...

Info
titleTip

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
      titleTip

      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
hiddentrue

Description of the Property Mediator in WSO2 ESB.