camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Willem Jiang <willem.ji...@gmail.com>
Subject Re: Handling CXF endpoint values
Date Tue, 15 Apr 2008 14:37:55 GMT
Hi ,
After I went through your mail,  I think I should point out what exactly 
CXF consumer do for the exchange.
In the CXF consumer , we just replace the regular invoker of the CXF 
endpoint , so we can direct the request to the Camel processors for 
further processing.

So what you get from the exchange.getIn() is the invoking parameter, all 
the magic things are happened in the CamelInvoker[1]'s  Object 
invoke(Exchange exchange, Object o) method.
The parameter could be an instance of List class or an Object due to the 
WSDL operation's parameter definition.

[1] 
https://svn.apache.org/repos/asf/activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CamelInvoker.java

Willem
rcollins wrote:
> Hi,
> I'm new to camel (and spring and web services), so apologies if the question
> seems obvious. I'm trying to map some of the values received in a web
> service call to a new endpoint. To validate what I'm doing I figured I'd
> take one of the values from my service and route it to a file using the file
> endpoint.
> I've defined a web service which can receive calls. Having got my web
> service receive calls fine I've defined my camel routing as follows:
>
>     <bean id="logInbound"
> class="org.apache.cxf.interceptor.LoggingInInterceptor"/>
>     <bean id="testProcessor" class="com.company.TestProcessor"></bean>
>
>     <cxf:cxfEndpoint id="notificationEndpoint"
>                      address="http://localhost:9080/Notification"
>                      serviceClass="com.company.NotificationImpl">
>         <cxf:inInterceptors>
>             <ref bean="logInbound"/>
>         </cxf:inInterceptors>
>     </cxf:cxfEndpoint>
>
>     <camelContext id="camel"
> xmlns="http://activemq.apache.org/camel/schema/spring">
>         <route>
>             <from uri="cxf:bean:notificationEndpoint"/>
>             <process ref="testProcessor"/>
>         </route>
>     </camelContext>
>
> I've added in the logging interceptor so I can see what's going on. My web
> service again starts fine. I can make calls to it and see the output which
> looking something like this:
>
> 15-Apr-2008 12:45:57 org.apache.cxf.interceptor.LoggingInInterceptor logging
> INFO: Inbound Message
> ----------------------------
> Encoding: UTF-8
> Headers: {content-type=[text/xml;charset="utf-8"], connection=[keep-alive],
> Host=[localhost:9080], Content-Length=[430], SOAPAction=[""],
> User-Agent=[JAX-WS RI 2.1.2_01-hudson-189-], Accept=[text/xml,
> multipart/related, text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2]}
> Messages: 
> Message:
>
> Payload: <?xml version="1.0" ?><S:Envelope
> xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"><S:Body>...</S:Body></S:Envelope>
>
> I added a simple processor just to see what was coming back. I can see a:
>
> org.apache.cxf.message.MessageContentsList 
>
> when I check exchange.getIn(). What is this object? I can see the input
> parameter I want is the second item in this list. In my case this is a class
> MyMessage which has a getMessage method on it. The JavaDoc for the
> MessageContentsList isn't very helpful. I'm not sure what I should be doing
> with it, how it gets populated and how I'd know where my class is in the
> list.
>
> So, back to the point of my question. How in my route can I get access to
> the object of the 'from' endpoint?
>
> I'm using Camel 1.3 and Java 1.6.0_05.
>   


Mime
View raw message