This site contains the documentation that is relevant to older WSO2 product versions and offerings.
For the latest WSO2 documentation, visit https://wso2.com/documentation/.

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 13 Next »

In addition to standard XPath functions, the ESB supports the following custom functions for working with XPath expressions:

base64Encode() function

The syntax of the function takes the following format.

  • base64Encode(string)

It returns the base64 encoded value of the string argument.

Next, see Synapse XPath Variables.

synapse:get-property()

The get-property() function allows any XPath expression used in a configuration to look up information from the current message context. Using the Property mediator, you can retrieve properties from the message context and header.

The syntax of the function takes the following format.

  • get-property(String propertyName)
  • get-property(String scope, String propertyName)

The function accepts scope as an optional parameter. It retrieves a message property at the given scope, which can be one of the following.

If you provide only the property name without the scope, the default Synapse scope will be used.

Default Scope

Message context properties within the Synapse scope can be retrieved from the default scope. In addition to the user-defined properties, you can retrieve the following special properties from the default scope.

NameReturn Value
ToIncoming URL as a String, or empty string («») if a To address is not defined.
FromFrom address as a String, or empty string («») if a From address is not defined.
ActionSOAP Addressing Action header value as a String, or empty string («») if an Action is not defined.
FaultToSOAP FaultTo header value as a String, or empty string («») if a FaultTo address is not defined.
ReplyToReplyTo header value as a String, or empty string («») if a ReplyTo address is not defined.
MessageIDA unique identifier (UUID) for the message as a String, or empty string («») if a MessageID is not defined. This ID is guaranteed to be unique.
FAULTTRUE if the message has a fault, or empty string if the message does not have a fault.
MESSAGE_FORMATReturns pox, get, soap11, or soap12 depending on the message. If a message type is unknown this returns soap12
OperationNameOperation name corresponding to the message. A proxy service with a WSDL can have different operations. If the WSDL is not defined, ESB defines fixed operations.
Axis2 scope

You can retrieve message context properties within the Axis2 scope using the following syntax.

Syntax:
get-property('axis2', String propertyName)

Transport scope

You can retrieve message context properties within the transport scope using the following syntax.

Syntax:
get-property('transport', String propertyName)

Registry scope

You can retrieve properties within the registry using the following syntax.

Syntax:
get-property('registry', String registryPath@propertyName)
get-property('registry', String registryPath)

System scope

You can retrieve Java System properties using the following syntax.

Syntax:
get-property('system', String propertyName)

Note: system scope is only available in WSO2 ESB 4.8.0 or later versions


  • No labels