I tried your script and got the same result as yours. Then he looked deep into it, as that was the main functionality, and as I thought, I had already done something similar before.
The problem here is the property type. For some strange reason, INTEGER
doesn't work here. You must have DOUBLE
or STRING
. Even if you have a line, it will display it correctly when you perform a comparison, as here. The following worked for me.
<inSequence> <log level="full"/> <property xmlns:m0="http://tempuri.org/" name="CParam" expression="//m0:SumSerViseResponse/m0:SumSerViseResult" scope="default" type="DOUBLE"/> <log level="custom"> <property name="CParam" expression="$ctx:CParam"/> </log> <property name="propertyA" value="4.0" scope="default" type="DOUBLE"/> <log level="custom"> <property xmlns:ns="http://org.apache.synapse/xsd" name="propertyA" expression="get-property('propertyA')"/> </log> <property name="propertyCompare" expression="$ctx:CParam > get-property('propertyA')" scope="default" type="BOOLEAN"/> <log level="custom"> <property name="propertyCompare" expression="get-property('propertyCompare')"/> </log> <filter xpath="$ctx:CParam > get-property('propertyA')"> <then> <send> <endpoint> <address uri="http://localhost:9000/services/SimpleStockQuoteService"/> </endpoint> </send> </then> <else> <drop/> </else> </filter> </inSequence>
source share