Note that there are some explanatory texts on larger screens.

plurals
  1. POFiltering in WSO2
    text
    copied!<p>I want to build one proxy that:<br/> 1. Call Service that do Authorize and give result OK or Fail (1st Service)<br/> 2. If Result ‘OK’ then call a Service </p> <p>The Problem is, when The 1st Service give back the Message : </p> <pre><code>&lt;?xml version='1.0' encoding='utf-8'?&gt; &lt;soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"&gt; &lt;soapenv:Body&gt; &lt;result&gt; &lt;status&gt;OK&lt;/status&gt; &lt;message&gt;&lt;/message&gt; &lt;/result&gt; &lt;/soapenv:Body&gt; &lt;/soapenv:Envelope&gt; </code></pre> <p>And I give “filtering” at Out Sequence. Here is the XML :</p> <pre><code>&lt;proxy xmlns="http://ws.apache.org/ns/synapse" name="TestProxy" transports="https,http" statistics="disable" trace="enable" startOnLoad="true"&gt; &lt;target endpoint="AuthorizationService"&gt; &lt;outSequence&gt; &lt;log level="full" /&gt; &lt;filter xpath="/result/status='OK'"&gt; &lt;then&gt; &lt;send&gt; &lt;endpoint&gt; &lt;address uri="http://192.168.1.140:8080/axis2/services/TaskService.TaskServiceHttpEndpoint/getTask" /&gt; &lt;/endpoint&gt; &lt;/send&gt; &lt;/then&gt; &lt;else&gt; &lt;makefault version="soap11"&gt; &lt;code xmlns:soap11Env="http://schemas.xmlsoap.org/soap/envelope/" value="soap11Env:VersionMismatch" /&gt; &lt;reason value="1" /&gt; &lt;role&gt;2&lt;/role&gt; &lt;detail&gt;3&lt;/detail&gt; &lt;/makefault&gt; &lt;/else&gt; &lt;/filter&gt; &lt;log level="full" /&gt; &lt;/outSequence&gt; &lt;/target&gt; &lt;/proxy&gt; </code></pre> <p>When I run my Application, the ESB always give the message :<br/></p> <pre><code>16:08:59,358 [-] [HttpClientWorker-4] INFO Start : Log mediator 16:08:59,361 [-] [HttpClientWorker-4] INFO To: http://www.w3.org/2005/08/addressing/anonymous, WSAction: , SOAPAction: , MessageID: urn:uuid:0bc33821-c4f1-448e-a7dc-be4194be8e99, Direction: response, Envelope: &lt;?xml version='1.0' encoding='utf-8'?&gt;&lt;soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"&gt;&lt;soapenv:Body&gt;&lt;result&gt;&lt;status&gt;OK&lt;/status&gt;&lt;message&gt;&lt;/message&gt;&lt;/result&gt;&lt;/soapenv:Body&gt;&lt;/soapenv:Envelope&gt; 16:08:59,361 [-] [HttpClientWorker-4] INFO End : Log mediator 16:08:59,361 [-] [HttpClientWorker-4] INFO Start : Filter mediator 16:08:59,361 [-] [HttpClientWorker-4] INFO XPath expression : /result/status='OK' evaluates to false - executing the else path child mediators </code></pre> <p>Seems like the condition of the filtering is always false.<br/>What is the correct statement for the XPath in the filter?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload