camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jon Anstey" <jans...@gmail.com>
Subject Re: JBI Wrapper
Date Thu, 11 Sep 2008 18:10:51 GMT
On Thu, Sep 11, 2008 at 3:39 PM, Jonathan Anstey <janstey@gmail.com> wrote:

> raulvk wrote:
>
>> Yeah, using XQuery sounds like a good solution. Unfortunately, I tried it
>> and even though my Eclipse IDE recognises the method, the Camel Context in
>> ServiceMix mowns with the following error:
>>
>> 18:47:16,717 | DEBUG - org.apache.camel.processor.Pipeline - Message
>> exchange has failed so breaking out of pipeline: Exchange[JbiMessage:
>> org.apache.servicemix.jbi.messaging.NormalizedMessageImpl@5a12d5
>> {properties:
>> {org.apache.camel.RedeliveryCounter=1,
>> javax.jbi.messaging.protocol.headers={},
>> org.apache.camel.Redelivered=true}}] exception:
>> org.apache.camel.NoSuchLanguageException: No language could be found for:
>> xquery fault: null
>>
>>
>
> You definitely need camel-saxon on your classpath... by quickly looking at
> http://svn.apache.org/repos/asf/servicemix/components/engines/servicemix-camel/trunk/pom.xmlit
seems that the Camel SE only loads up camel-core and camel-spring.
>
> Any ServiceMix gurus out there know how to load this dependency up with
> servicemix-camel?
>
>
>> Perhaps this is only available from a certain Camel version up?
>>
>>
>
> Its been there at least since Camel 1.1
>
>  Actually, I want to apply the transformation on the In Message Body, and
>> overwrite it with the result, because the next endpoint along is Camel's
>> Validator with an XML Schema to check the message against. So I assume the
>> input should be in the In Message of the Exchange, not on the Out.
>>
>>
>
> You can use .setInBody()


I mean setBody(), like Claus said :)



>
>
>  Also, the fact that the exchange is actually a JbiExchange doesn't affect
>> the usage of XQuery or XPath, right?
>>
>>
>
> It shouldn't :)
>
>  Another question: why can't I use XPath??? Is it only possible to use
>> XPath
>> in Camel to write testing conditions for routing?
>>
>>
>
> Thats all I've used it for.
>
>
>  Thanks.
>>
>>
>> Claus Ibsen wrote:
>>
>>
>>> Hi
>>>
>>> What about good old fashioned regular expression? ;)
>>>
>>> That reminds me, do we have a nice expression for this in Camel to use
>>> with the transform?
>>>
>>> BTW: Check out Jonathans new unit test and you can see that you can use
>>> Camel directly with xquery.
>>>
>>>
>>> Med venlig hilsen
>>>  Claus Ibsen
>>> ......................................
>>> Silverbullet
>>> Skovsgårdsvænget 21
>>> 8362 Hørning
>>> Tlf. +45 2962 7576
>>> Web: www.silverbullet.dk
>>> -----Original Message-----
>>> From: raulvk [mailto:raul.kripalani@atosorigin.com] Sent: 11. september
>>> 2008 19:45
>>> To: camel-user@activemq.apache.org
>>> Subject: Re: JBI Wrapper
>>>
>>>
>>> Hi,
>>>
>>> Thanks for the reply.
>>>
>>> Is there a way of doing it without having to construct an XSLT sheet +
>>> the
>>> Saxon SU? By using XPath to SELECT the node-set that I want
>>>
>>> Thanks.
>>>
>>>
>>> janstey wrote:
>>>
>>>
>>>> You can do this with the camel-saxon component. I've added a similar
>>>> test
>>>> at
>>>>
>>>>
>>>> http://svn.apache.org/repos/asf/activemq/camel/trunk/components/camel-saxon/src/test/java/org/apache/camel/builder/saxon/XQueryTransformTest.java
>>>>
>>>> raulvk wrote:
>>>>
>>>>
>>>>> Hi,
>>>>>
>>>>> I am using Camel to control the flow of validation, transformation and
>>>>> routing tasks that are applied to messages entering via ServiceMix
>>>>> CXF's
>>>>> Binding Component. The CXF consumer endpoint sends the message
>>>>> straightaway
>>>>> to Camel.
>>>>>
>>>>> When validating the incoming message, I realized that it is surrounded
>>>>> by
>>>>> the <jbi:message> wrapper.
>>>>> How can I get rid of it so as to send the ACTUAL XML message to Camel's
>>>>> validator?
>>>>>
>>>>> I have tried the following:
>>>>>
>>>>>  -   .setBody().xpath("//jbi:message/jbi:part/can:IncomingMessage",
>>>>> m).to("validator:file:///<schemaLocation>")
>>>>>
>>>>>    AND
>>>>>  .   .transform().xpath("//jbi:message/jbi:part/can:IncomingMessage",
>>>>> m).to("validator:file:///<schemaLocation>")
>>>>>
>>>>> m is bound to a HashMap containing the NameSpace mappings.
>>>>>
>>>>> However, the result is always an empty XML Body, which provokes an
>>>>> exception
>>>>> at the Validator.
>>>>>
>>>>> Is there an easy way of EXTRACTING the XML payload?
>>>>>
>>>>> Thank you.
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/JBI-Wrapper-tp19439139s22882p19440442.html
>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>
>>>
>>>
>>>
>>>
>>
>>
>>
>
>


-- 
Cheers,
Jon

http://janstey.blogspot.com/

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message