Versions Compared

Key

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

There is a set of predefined XPath variables that you can directly use to write XPaths in the Synapse configuration, instead of using the synapse:get-property() function. These XPath variables get properties of various scopes as follows:

Table of Contents
maxLevel3
minLevel3

$body

The SOAP 1.1 or 1.2 body element. For example, the expression $body/getQuote refers to the first getQuote element in a SOAP body, regardless of whether the message is SOAP-11 or SOAP-12. We have discussed an example below.

...

Code Block
[2013-03-18 14:04:41,019] INFO - LogMediator To: /services/StockQuoteProxy, WSAction: urn:getQuote, SOAPAction: urn:getQuote, ReplyTo: http://www.w3.org/2005/08/addressing/anonymous, MessageID: urn:uuid:930f68f5-199a-4eff-90d2-ea679c2362ab, Direction: request, stockprop = <m0:getQuotexmlns:m0="http://services.samples"><m0:request><m0:symbol>IBM</m0:symbol></m0:request></m0:getQuote>

$Header

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

...

Code Block
[2013-03-18 14:14:16,356] INFO - LogMediator To: http://localhost:9000/services/SimpleStockQuoteService, WSAction: urn:getQuote, SOAPAction: urn:getQuote, ReplyTo: http://www.w3.org/2005/08/addressing/anonymous, MessageID: urn:uuid:8a64c9cb-b82f-4d6f-a45d-bef37f8b664a, Direction: request,
stockprop = http://localhost:9000/services/SimpleStockQuoteService

$axis2

Prefix for Axis2 MessageContext properties. This is used to get the property value at the axis2 scope. For example, to get the value of Axis2 message context property with name REST_URL_POSTFIX, use the XPath expression $axis2:REST_URL_POSTFIX. We have discussed an example below.

...

Similarly, you can use $axis2 prefix with HTTP Transport Properties.

$ctx

Prefix for Synapse MessageContext properties and gets a property at the default scope. For example, to get the value of Synapse message context property with name ERROR_MESSAGE, use the XPath expression $ctx:ERROR_MESSAGE. We have discussed an example below.

...

In this example, the property definition, <property name="stockerrorprop" expression="$ctx:ERROR_MESSAGE"/> is equivalent to <property name="stockerrorprop" expression="get-property('ERROR_MESSAGE')"/>.

Similarly, you can use $ctx prefix with Generic Properties.

$trp

Prefix used to get the transport headers. For example, to get the transport header named Content-Type of the current message, use the XPath expression $trp:Content-Type. HTTP transport headers are not case sensitive. Therefore, $trp:Content-Type and $trp:CONTENT-TYPE are regarded as the same. We have discussed an example below.

...