This documentation is for WSO2 Enterprise Service Bus version 4.8.1 . View documentation for the latest release.

Versions Compared


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


In this configuration, a response is sent to the client based on the Accept header. The PayloadFactory mediator transforms the message contents. Then a Property mediator sets the message type based on the Accept header using the $ctx:accept expression. The message is then sent back to the client via the Respond mediator.


There are a set of predefined XPath variables that you can directly use in the Synapse configuration, instead of using the synapse:get-property() function. These XPath variables get properties of various scopes. For more information on these XPath variables, see Synapse XPath Variables.

Code Block
<payloadFactory media-type="xml">
        <m:getQuote xmlns:m="http://services.samples">
<property name="messageType" expression="$ctx:accept" scope="axis2" />