-
1. Re: Camel implementation - xquery transformation.
splatch Mar 20, 2013 3:32 PM (in response to solimo)XQuery transfomation is not part of camel core, and as you found it's because camel-saxon is absent. The problem comes from fact that camel DSL is split from component providing it. This causes that some DSL elements are available even if there is no implementation provided. That's true also for languages, data formats and so on. As workaround - you may package camel-saxon as AS7 module and then declare dependency on it for your deployment unit using Dependencies manifest header or jboss-modules xml.
-
2. Re: Camel implementation - xquery transformation.
solimo Mar 21, 2013 6:51 AM (in response to splatch)Thanks for the direction. Any way, even with camel-sacon AS7 module deployed and added as a apache camel core module dependency or maven plugin which you recommended for my deployment unit, language is not recognized. Are you sure that it is sufficient?
-
3. Re: Camel implementation - xquery transformation.
splatch Mar 21, 2013 8:58 AM (in response to solimo)Yes,
I'm sure it should work with custom descriptor. I tested it and the configuration which works for me:
META-INF/jboss-deployment-structure.xml for deployment unit
<?xml version="1.0" encoding="UTF-8"?> <jboss-deployment-structure> <deployment> <dependencies> <module name="org.apache.camel.saxon" services="import" export="true"> <imports> <include path="META-INF/services/org/apache/camel/component" /> <include path="META-INF/services/org/apache/camel/language" /> </imports> <exports> <include path="META-INF/services/org/apache/camel/component" /> <include path="META-INF/services/org/apache/camel/language" /> </exports> </module> </dependencies> </deployment> </jboss-deployment-structure>
camel-saxon module.xml
<?xml version="1.0" encoding="UTF-8"?> <module xmlns="urn:jboss:module:1.0" name="org.apache.camel.saxon"> <resources> <resource-root path="camel-saxon-2.10.0.jar"/> <resource-root path="saxon9he-9.3.0.11.jar"/> </resources> <dependencies> <module name="javax.api"/> <module name="org.slf4j"/> <module name="org.apache.camel.core"/> </dependencies> </module>
Then I was able to use XQuery (I adapted soap-proxy quickstar):
<route xmlns="http://camel.apache.org/schema/spring"> <from uri="switchyard://ProxyService"/> <to uri="log:xq?showAll=true" /> <convertBodyTo type="org.w3c.dom.Document" /> <filter> <xquery>//*[local-name() = 'test']/text() != 'exception'</xquery> <to uri="switchyard://ReverseService"/> </filter> </route>
(when contents of incoming query is different than exception then external web service is called)
Cheers,
Lukasz
-
modules.zip 2.0 MB
-
-
4. Re: Camel implementation - xquery transformation.
solimo Mar 24, 2013 7:30 AM (in response to splatch)Thanks. It was my fault indeed - languages were not exported.