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

Versions Compared

Key

  • 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.

Info
titleNote

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
languagexml
<payloadFactory media-type="xml">
    <format>
        <m:getQuote xmlns:m="http://services.samples">
            <m:request>
                <m:symbol>Error</m:symbol>
            </m:request>
        </m:getQuote>
    </format>
</payloadFactory>
<property name="messageType" expression="$ctx:accept" scope="axis2" />
<respond/>

...