Hi Marc

Please see my comments in the mail.

Marc Giger wrote:
Hi Willem,

On Mon, 18 Feb 2008 08:54:02 +0800
Willem Jiang <[EMAIL PROTECTED]> wrote:

Hi Marc,

From your configuration , you just route the request in POJO data format mode. You can configure the router to use the MESSAGE data format by adding the data format parameter in the endpoint URI like this.

<camelContext id="camel"
xmlns="http://activemq.apache.org/camel/schema/spring";>

   <route>
     <from uri="cxf:bean:routerEndpoint?dataFormat=MESSAGE"/>
     <to uri="cxf:bean:serviceEndpoint?dataFormat=MESSAGE"/>
   </route>
</camelContext>

Do I need to specify the dataFormat on the incoming and outgoing
endpoint? What happens if the destination (to uri) is a local cxf-bean
with JAX-Binding and the dataFormat on the incoming endpoint (from
uri) dataFormat is still set to MESSAGE?
If you do not specify the dataFormat, camel-cxf will treat the endpoint working as the POJO mode In this mode, CxfConsumer will unmashall the request message to a method name and a list of parameter with the Java object and CxfProducer will mashall a list of parameteer and method
into a soap request.

If you set the dataFormat to be MESSAGE , it will skip most of binding interceptors and just redirect the incoming input stream to the outgoing output stream or redirect the outgoing
output stream to the input stream.

You had to make the from and to cxf endpoint's date Format to be same, since the interceptors in the these endpoint should be pair or the message
passed from router to then service endpoint can't be handled properly.

Since I just fixed an issue that spring cxf endpoint can't be
configured properly with MESSAGE or PAYLOAD data format yesterday,
you may need to try out the latest snap shot of camel.

Is camel-cxf-1.3-20080216.034155-72.jar the latest snapshot?
If I specify the dataFormat on both endpoints as you sugested, I get
the following error on startup:
org.apache.cxf.service.factory.ServiceConstructionException: Could not
find portType named
{http://SDService}SDServiceImplPortType

I don't know where the name "SDServiceImplPortType" comes from...

If I leave the dataFormat on the serviceEndpoint, I get a NPE.

Any ideas?
You have to use the snapshot later than 20080217 .

{http://SDService}SDServiceImplPortType is the port name of your service.
It can come from the WSDL or the WebService annotation or the port name
that you specified in cxf:endpoint bean.


BTW , in MESSAGE mode , the camel-cxf component just exchange the
input stream from the transport layer, it  will never touch or change
any contents in the message.  I think it will fulfill your
requirement.

Sounds good;-)

Btw:

Should the following work?:

<camelContext id="camel"
xmlns="http://activemq.apache.org/camel/schema/spring";>
   <route>
     <from uri="cxf:bean:routerEndpoint"/>
     <to uri="file://req"/>
   </route>
</camelContext>

If you add the ?dataFormate=Message , I think you will get request xml to be stored in the file.
I don't know what will happen if you use the default date format :(.
Thanks!

Marc


Willem.
Cheers,

Willem.

Marc Giger wrote:
Hi,

I'm new to camel and have a question regarding message mode routing.

I have the following setup configured in spring:

<cxf:cxfEndpoint id="routerEndpoint"
address="/SDService"
serviceClass="SDServiceImpl"/>

<cxf:cxfEndpoint id="serviceEndpoint"
address="http://host1:8080/SDService";
wsdlURL="wsdl/SDService.wsdl"
endpointName="s:SDPort"
serviceName="s:SDService"
xmlns:s="http://SDService"/>

<camelContext id="camel"
xmlns="http://activemq.apache.org/camel/schema/spring";>

   <route>
     <from uri="cxf:bean:routerEndpoint"/>
     <to uri="cxf:bean:serviceEndpoint"/>
   </route>
</camelContext>

If I send a request to the routerEndpoint the soap-requests
is sent to the serviceEndpoint but:

The whole content of the original SOAP-Header is missing on the
serviceEndpoint side.

My requirement is that incoming message, which is digitally signed,
is routet inclusive soap-header and nowhere in the path modified.

So is it possible to route a message inclusive soap-header?
Also a incoming message must not be read in a DOM and
serialized from DOM because otherwise we destroy the signature.

Can these requirements be fullfilled with camel?

If yes, could you give me an example spring configuration?

Thanks a lot

Marc



Reply via email to