camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexandros Karypidis <akary...@yahoo.gr>
Subject Re: Newbiew: from(cxf).to(file) doesn't work
Date Mon, 23 Nov 2009 07:59:11 GMT
Bingo!

File is written correctly now.

Thanks!

Claus Ibsen wrote:
> On Mon, Nov 23, 2009 at 8:47 AM, Alexandros Karypidis <akarypid@yahoo.gr> wrote:
>   
>> I changed my Router to read:
>>
>> from("cxf:bean:asyncMessagingProvider").to("log:AsyncMessaging").to("file:///outfiles/");
>> instead of:
>>       from("cxf:bean:asyncMessagingProvider").to("file:///outfiles/");
>>
>>     
>
> Try adding a .convertBodyTo(String.class) just before the .to(file)
> Then the file producer works with a string type instead of the CXF
> MessageContentList
>
>
>
>   
>> Now, I can see the SOAP envelope in the output as it passes through the log
>> endpoint, but the file endpoint fails in a similar fashion:
>>
>> 09:41:43,312 DEBUG ProcessorEndpoint$1:66 - Starting producer:
>> Producer[log://AsyncMessaging]
>> 09:41:43,343 DEBUG ProducerCache:201 - Adding to producer cache with key:
>> Endpoint[log://AsyncMessaging] for producer: Producer[log://AsyncMessaging]
>> 09:41:43,343 DEBUG DefaultPackageScanClassResolver:92 - Searching for
>> annotations of org.apache.camel.Converter in packages:
>> [org.apache.camel.component.file, org.apache.camel.converter,
>> org.apache.camel.spring.converter, org.apache.camel.component.cxf.converter]
>>
>> --->    A lot of output as the classpath is scanned for "converters" and
>> findings are reported
>>
>> 09:41:43,593 DEBUG DefaultTypeConverter:170 - Adding fallback type converter
>> as a known type converter to convert from: java.lang.String to:
>> org.apache.cxf.message.MessageContentsList
>>
>> ---> SEE THE SOAP MESSAGE BELOW
>>
>> 09:41:43,593  INFO AsyncMessaging:88 -
>> Exchange[BodyType:org.apache.cxf.message.MessageContentsList,
>> Body:<soap:Envelope
>> xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Header/><soap:Body><ns2:deliver
>> xmlns:ns2="http://messaging2/"><content xmlns="">This is a
>> test</content></ns2:deliver></soap:Body></soap:Envelope>]
>>
>> ---> THE FILE PRODUCER STILL FAILS
>>
>> 09:41:43,593 DEBUG GenericFileProducer:66 - Starting producer:
>> Producer[file:///outfiles/]
>> 09:41:43,593 DEBUG ProducerCache:201 - Adding to producer cache with key:
>> Endpoint[file:///outfiles/] for producer: Producer[file:///outfiles/]
>> 09:41:43,593 DEBUG DefaultErrorHandler:197 - Failed delivery for exchangeId:
>> ID-athka536anb-2640-1258961881406-0-0. On delivery attempt: 0 caught:
>> org.apache.camel.component.file.GenericFileOperationFailedException: Cannot
>> store file: \outfiles\ID-athka536anb-2640-1258961881406-1-0
>> 09:41:43,609 DEBUG DefaultErrorHandler:361 - This exchange is not handled so
>> its marked as failed: Exchange[Message:
>> [com.sun.xml.messaging.saaj.soap.ver1_1.Message1_1Impl@190949b]]
>> 09:41:43,609 DEBUG Pipeline:99 - Message exchange has failed so breaking out
>> of pipeline: Exchange[Message:
>> [com.sun.xml.messaging.saaj.soap.ver1_1.Message1_1Impl@190949b]] Exception:
>> org.apache.camel.component.file.GenericFileOperationFailedException: Cannot
>> store file: \outfiles\ID-athka536anb-2640-1258961881406-1-0
>>
>>
>> Alexandros Karypidis wrote:
>>     
>>> Hi,
>>>
>>> I'm trying to create my "hello world" of  CXF 2.2.4 + Camel 2.0.0. The
>>> idea is simple: I publish a WSDL as a camel-cxf endpoint and add a route to
>>> a file endpoint. If I understand correctly, that would lead to files being
>>> created in a folder, containing the SOAP xml of the web service. When I call
>>> the web service, camel logs:
>>>
>>> 23:32:12,375 DEBUG DefaultErrorHandler:197 - Failed delivery for
>>> exchangeId: ID-athka536anb-1479-1258925491062-0-0. On delivery attempt: 0
>>> caught: org.apache.camel.component.file.GenericFileOperationFailedException:
>>> Cannot store file: \outfiles\ID-athka536anb-1479-1258925491062-1-0
>>> 23:32:12,375 DEBUG DefaultErrorHandler:361 - This exchange is not handled
>>> so its marked as failed: Exchange[Message:
>>> [com.sun.xml.messaging.saaj.soap.ver1_1.Message1_1Impl@72e235]]
>>>
>>> My Spring beans.xml looks like:
>>>
>>>   ...
>>>   xmlns:camel-cfg="http://camel.apache.org/schema/spring"
>>>   xmlns:camel-cxf="http://camel.apache.org/schema/cxf"
>>>   ...
>>>
>>>   <camel-cxf:cxfEndpoint id="asyncMessagingProvider"
>>>       address="/AsyncMessagingServiceProvider"
>>> serviceClass="svc.impl.messaging.AsyncMessagingServiceProvider"
>>>       wsdlURL="WEB-INF/wsdl/AsyncMessaging-Oneway-SOAP11.wsdl" />
>>>
>>>   <bean id="asyncRouteBuilder"
>>> class="svc.impl.messaging.AsyncRouteBuilder" />
>>>
>>>   <camel-cfg:camelContext id="camelContext">
>>>       <camel-cfg:routeBuilder ref="asyncRouteBuilder" />
>>>   </camel-cfg:camelContext>
>>>
>>> The router has a configure() as follows:
>>>
>>>   @Override
>>>   public void configure() throws Exception {
>>>       from("cxf:bean:asyncMessagingProvider").to("file:///outfiles/");
>>>   }
>>>
>>> When I call the web service, the folder "/outfiles" is created, which
>>> makes it appear that the route is connected properly, but no file is put
>>> inside it. Again, all I see (I have enabled debug-level logging) is:
>>>
>>> 23:32:12,375 DEBUG DefaultErrorHandler:197 - Failed delivery for
>>> exchangeId: ID-athka536anb-1479-1258925491062-0-0. On delivery attempt: 0
>>> caught: org.apache.camel.component.file.GenericFileOperationFailedException:
>>> Cannot store file: \outfiles\ID-athka536anb-1479-1258925491062-1-0
>>> 23:32:12,375 DEBUG DefaultErrorHandler:361 - This exchange is not handled
>>> so its marked as failed: Exchange[Message:
>>> [com.sun.xml.messaging.saaj.soap.ver1_1.Message1_1Impl@72e235]]
>>>       
>>     
>
>
>
>   


Mime
View raw message