Versions Compared

Key

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

...

The prefix used to get the URI element of a request URL.

Example of $url usage:

  1. Create a REST API with the following configuration using instructions given in page Creating APIs.

    Code Block
    languagexml
    <api xmlns="http://ws.apache.org/ns/synapse" name="Editing" context="/editing">
       <resource methods="GET" uri-template="/edit?a={symbol}&b={value}">
          <inSequence>
             <log level="full">
                <property name="SYMBOL" expression="$url:a"></property>
                <property name="VALUE" expression="$url:b"></property>
             </log>
             <respond></respond>
          </inSequence>
       </resource>
    </api>
  2. Send a request to the REST API you created using a browser as follows:

    Code Block
    languagexml
     http://10.100.5.73:8280/editing/edit?a=wso2&b=2.4

    You would You will see the following in the ESB log:
     

    Code Block
    languagexml
    LogMediator To: /editing/edit?a=wso2&b=2.4, MessageID: urn:uuid:36cb5ad7-f150-490d-897a-ee7b86a9307d, Direction: request, SYMBOL = wso2, VALUE = 2.4, Envelope: <?xml version="1.0" encoding="utf-8"?><soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope"><soapenv:Body></soapenv:Body></soapenv:Envelope>

...