Versions Compared

Key

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

...

1. Deploy the following proxy service using instructions in Adding a Proxy Service.

Note the property, <property xmlns:m0=" http://services.samples " name="stockprop" expression="$body/m0:getQuote"/> in the configuration. It is used to log the first <m0:getQuote> element of the request SOAP body.

...

2. Send the following StockQuote request using the sample StockQuote client. For information on the sample client, refer to the Sample Clients sub heading in ESB Samples Setup.

ant stockquote -Daddurl=http://localhost:8280/services/StockQuoteProxy

...

1. Deploy the following proxy service using instructions in Adding a Proxy Service.

Note the property, <property xmlns:wsa=" http://www.w3.org/2005/08/addressing " name="stockprop" expression="$header/wsa:To"/> in the configuration. It is used to log the value of wsa:To header of the SOAP request.

...

2. Send the following StockQuote request using the sample StockQuote client. For information on the sample client, refer to the Sample Clients sub heading in ESB Samples Setup.

ant stockquote -Daddurl=http://localhost:8280/services/StockQuoteProxy

...

1. Deploy the following proxy service using instructions in Adding a Proxy Service.

Note the property, <property name="stockprop" expression="$axis2:REST_URL_POSTFIX"/> in the configuration which is used to log the REST_URL_POSTFIX value of the request message.

...

2. Send the following StockQuote request using the sample StockQuote client. For information on the sample client, refer to the Sample Clients sub heading in ESB Samples Setup.

ant stockquote -Daddurl=http://localhost:8280/services/StockQuoteProxy/test/prefix 

...

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.

...

1. Deploy the following proxy service using instructions in Adding a Proxy Service.

Note the property, <property name="stockerrorprop" expression="$ctx:ERROR_MESSAGE"/> in the fault sequence configuration. It is used to log the error message that occurs due to a  mediation fault.

...

2. Send the following StockQuote request using the sample StockQuote client. For information on the sample client, refer to the Sample Clients sub heading in ESB Samples Setup.

ant stockquote -Dtrpurl=http://localhost:8280/services/StockQuoteProxy

...

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.

Example of $trp usage:

1. Deploy the following proxy service using instructions given in section Adding a Proxy Service.

Note the property, <property name="stockprop" expression="$trp:Content-Type"/> in the configuration, which is used to log the Content-Type HTTP header of the request message.

...

2. Send the following StockQuote request using the sample StockQuote client. For information on the sample client, refer to the Sample Clients sub heading in ESB Samples Setup.

ant stockquote -Daddurl=http://localhost:8280/services/StockQuoteProxy

...

In this example, the property definition, <property name="stockprop" expression="$trp:Content-Type"/> is equivalent to <property name="stockprop" expression="get-property('transport','Content-Type')"/>. Similarly, you can use $trp prefix with HTTP Transport Properties.