synapse-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Benjamin Schmeling <benjamin.schmel...@googlemail.com>
Subject Re: Synapse2: Question about XPath Expressions in SwitchMediator
Date Thu, 03 Feb 2011 09:21:41 GMT
Hi,

have you already fixed the problem with xpath in switch? I've
installed the 2.0 release of Synapse, but the problem still remains.

Thanks,

Benjamin

On Sat, Dec 18, 2010 at 12:34 AM, Paul Fremantle <pzfreo@gmail.com> wrote:
> Thanks Benjamin.
>
> Paul
>
> On Fri, Dec 17, 2010 at 5:42 PM, Benjamin Schmeling
> <benjamin.schmeling@googlemail.com> wrote:
>> Hi,
>>
>> to fix it you can replace the following line in
>> SynapseXPathFactory.getSynapseXPath(elem, ATT_SOURCE):
>>
>> LINE 47: xpath = new SynapseXPath(xpathAttrib.getAttributeValue());
>>
>> by xpath = SynapseXPath.parseXPathString(xpathAttrib.getAttributeValue());
>>
>> Thanks,
>>
>> Benjamin
>>
>>
>> On Wed, Dec 15, 2010 at 3:16 PM, Ruwan Linton <ruwan.linton@gmail.com> wrote:
>>> I think you are correct, let me have a look at using the parseXPathString
>>> instead of the current one.
>>> Thanks,
>>> Ruwan
>>>
>>> On Wed, Dec 15, 2010 at 5:21 PM, Benjamin Schmeling
>>> <benjamin.schmeling@googlemail.com> wrote:
>>>>
>>>> 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
>>>>
>>>
>>>
>>>
>>> --
>>> Ruwan Linton
>>> Software Architect & Product Manager, WSO2 ESB; http://wso2.org/esb
>>> WSO2 Inc.; http://wso2.org
>>>
>>> Lean . Enterprise . Middleware
>>>
>>> phone: +1 408 754 7388 ext 51789
>>> email: ruwan@wso2.com; cell: +94 77 341 3097
>>> blog: http://blog.ruwan.org
>>> linkedin: http://www.linkedin.com/in/ruwanlinton
>>> google: http://www.google.com/profiles/ruwan.linton
>>> tweet: http://twitter.com/ruwanlinton
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
>> For additional commands, e-mail: dev-help@synapse.apache.org
>>
>>
>
>
>
> --
> Paul Fremantle
> Co-Founder and CTO, WSO2
> Apache Synapse PMC Chair
> OASIS WS-RX TC Co-chair
>
> blog: http://pzf.fremantle.org
> paul@wso2.com
>
> "Oxygenating the Web Service Platform", www.wso2.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
> For additional commands, e-mail: dev-help@synapse.apache.org
>
>

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


Mime
View raw message