synapse-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Benjamin Schmeling <benjamin.schmel...@googlemail.com>
Subject Synapse2: Question about XPath Expressions in SwitchMediator
Date Wed, 15 Dec 2010 11:22:11 GMT
Hi,

I am using Apache Synapse 2.0-SNAPSHOT and I have a problem with XPATH
expressions.

I have defined the following configuration:

..
<configuration:switch
source="{http://mytravelagency.com}searchFlights/{http://mytravelagency.com}destination">
..

which should be a a valid XPATH expression.

Synapse throws the following exception:

ERROR SynapseServer - Error starting Apache Synapse, trying a clean shutdown...
org.apache.synapse.SynapseException: Invalid XPath for attribute
'source' : {http://mytravelagency.com}searchFlights/{http://mytravelagency.com}destination
        at org.apache.synapse.config.xml.SwitchMediatorFactory.createSpecificMediator(SwitchMediatorFactory.java:71)
        at org.apache.synapse.config.xml.AbstractMediatorFactory.createMediator(AbstractMediatorFactory.java:88)
        ......

I've also looked at the code and saw that the SwitchMediatorFactory
directly calls new SynapseXPath(xpathAttrib.getAttributeValue()),
whereas in your test cases you are rather using the
SynapseXPath.parseXPathString(XPATHString) method which does some
preprocessing especially with namespaces. Wouldn't it be better to use
that method in the Switch MediatorFactory instead ?

Thanks,

Benjamin

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org


Mime
View raw message