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.
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?
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>
<?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-18.104.22.168.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)
modules.zip 2.0 MB
Thanks. It was my fault indeed - languages were not exported.