Apache Synapse supports standard XPath functions and variables through its underlying XPath engine. Apart from standard XPath functions, there are several custom XPath functions and variables defined by Synapse to retrieve various message context properties.
Get property function retrieves a property from the message context at the given scope. If the scope is not specified, property is retrieved from the default synapse scope.
Syntax:
Message context properties residing in Synapse scope can be retrieved from the default scope. These are the properties directly set on the Synapse MessageContext instance. Apart from user defined properties, following special properties can also be retrieved from the default scope.
Name | Return Value |
To | Incoming URL as a String or empty string if a To address is not defined. |
From | From address as a String or empty string if a From address is not defined |
Action | SOAP Action header value as a String or empty string if a Action is not defined |
FaultTo | SOAP FautTo header value as a String or empty string if a FaultTo address is not defined |
ReplyTo | ReplyTo header value as a String or empty string if a ReplyTo address is not defined |
MessageID | A unique identifier (UUID) for the message as a String . This id is guaranteed to be unique. |
FAULT | TRUE if the message has a fault or empty string if message doesn't have a fault |
MESSAGE_FORMAT | Returns pox, get, soap11, soap12 depending on the message. If a message type is unknown this returns soap12 |
OperationName | Operation name corresponding to the message. |
Message context properties residing in axis2 scope can be retrieved from the axis2 scope. These are the properties set on the underlying Axis2 MessageContext object.
Message context properties residing in transport scope can be retrieved from the transport scope. These are the transport headers set on the MessageContext.
Properties residing in registry can be retrieved from the registry scope.
Java System properties can be retrieved from the system scope.
Returns the base64 encoded value of the argument.
Syntax:
Returns the base64 decoded value of the argument.
Syntax:
There are several XPath variables supported by Synapse. These are used for accessing various properties from the message context
These XPath variables get the properties at various scopes.
Variable prefix for accessing the MessageContext properties in default scope.
i.e To get the property named 'foo' at the default scope use the following XPath expression
Variable prefix for accessing the axis2 MessageContext properties
i.e. To get the property named 'messageType' use the following XPath expression
Variable prefix for accessing transport headers of the message
i.e. To get the transport header named Content-Type use the following XPath expression
Variable prefix for accessing URL parameters of the message
i.e. To get the URL parameter named 'bar' use the following XPth expression
Get the message body
Get the soap header