WSO2 get value from service response
<p>I have this rest api in WSO2 ESB:</p>

<pre><code>&lt;api xmlns="http://ws.apache.org/ns/synapse" name="RestApi" context="/rest"&gt;
   &lt;resource methods="POST GET" uri-template="/view/{symbol}" protocol="http"&gt;
      &lt;inSequence&gt;
         &lt;log level="full"/&gt;
         &lt;payloadFactory media-type="xml"&gt;
            &lt;format&gt;
               &lt;soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:web="http://www.w3schools.com/webservices/"&gt;
                  &lt;soapenv:Header/&gt;
                  &lt;soapenv:Body&gt;
                     &lt;web:FahrenheitToCelsius&gt;
                        &lt;web:Fahrenheit&gt;$1&lt;/web:Fahrenheit&gt;
                     &lt;/web:FahrenheitToCelsius&gt;
                  &lt;/soapenv:Body&gt;
               &lt;/soapenv:Envelope&gt;
            &lt;/format&gt;
            &lt;args&gt;
               &lt;arg evaluator="xml" expression="get-property('uri.var.symbol')"/&gt;
            &lt;/args&gt;
         &lt;/payloadFactory&gt;
         &lt;property name="DISABLE_CHUNKING" value="true" scope="axis2"/&gt;
         &lt;send&gt;
            &lt;endpoint&gt;
               &lt;address uri="http://www.w3schools.com/webservices/tempconvert.asmx" format="soap11"/&gt;
            &lt;/endpoint&gt;
         &lt;/send&gt;
      &lt;/inSequence&gt;
      &lt;outSequence&gt;
         &lt;property name="messageType" value="application/json" scope="axis2"/&gt;
         &lt;property name="msgbody" expression="$body" scope="default" type="STRING"/&gt;
         &lt;log level="custom"&gt;
            &lt;property name="To" expression="get-property('msgbody')"/&gt;
         &lt;/log&gt;
         &lt;payloadFactory media-type="json"&gt;
            &lt;format&gt;{"Status":"evgeni"}&lt;/format&gt;
            &lt;args/&gt;
         &lt;/payloadFactory&gt;
         &lt;send/&gt;
      &lt;/outSequence&gt;
      &lt;faultSequence/&gt;
   &lt;/resource&gt;
&lt;/api&gt;
</code></pre>

<p>The important part is the <code>&lt;outSequence&gt;&lt;/outSequence&gt;</code>
The property <code>&lt;property name="msgbody" expression="$body" scope="default" type="STRING"/&gt;</code> returns the response from the soap service. It looks like this:</p>

<pre><code>&lt;soap:Body xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"&gt;
    &lt;FahrenheitToCelsiusResponse xmlns="http://www.w3schools.com/webservices/"&gt;     
        &lt;FahrenheitToCelsiusResult&gt;4.44444444444444&lt;/FahrenheitToCelsiusResult&gt;
    &lt;/FahrenheitToCelsiusResponse&gt;
&lt;/soap:Body&gt;
</code></pre>

<p>I want to get just the value of <code>FahrenheitToCelsiusResult</code> (4.44444444444444). How can I do that?</p>

<p>I tried:</p>

<pre><code> &lt;property xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
   name="msgbody" 
   expression="$body/soap:Body/FahrenheitToCelsiusResponse/FahrenheitToCelsiusResult" 
   scope="default" type="STRING"/&gt;
</code></pre>

<p>but it returns an empty string.</p>