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 08:07:13 GMT
Also correct. Using "Source" will dump the file without the need for an 
explicit ".convertBodyTo(String.class)".

Willem Jiang wrote:
> Hi
>
> Can you change your SOAPMessage to Source and try again ?
> I don't think SOAPMessage can be serialized directly.
>
> Willem
> Alexandros Karypidis wrote:
>> My provider is below. It basically throws an unchecked exception, as 
>> it should not get invoked (due to the camel router picking up the 
>> message). Indeed, I never see an exception being thrown, nor does the 
>> debugger (I've set a breakpoint) ever stop there.
>>
>> @WebServiceProvider(
>>    targetNamespace = "http://messaging2/",
>>    serviceName = "AsyncMessagingService",
>>    portName = "AsyncMessagingImplPort",
>>    wsdlLocation = "WEB-INF/wsdl/AsyncMessaging-Oneway-SOAP11.wsdl")
>> @ServiceMode(Mode.MESSAGE)
>> @BindingType(value = HTTPBinding.HTTP_BINDING)
>>
>> public class AsyncMessagingServiceProvider implements 
>> Provider<SOAPMessage> {
>>    @Override
>>    public SOAPMessage invoke(SOAPMessage request) {
>>        throw new RuntimeException("Camel router should pick this up!");
>>    }
>> }
>>
>>
>> Willem Jiang wrote:
>>> Can I have a look at your provider's code?
>>> From the stack trace I think you need to make sure the message of 
>>> exchange can be serialized.
>>> As Adrian said, you also need to set the response back for camel-cxf 
>>> component to return the response.
>>>
>>> Willem
>>>
>>>
>>> Adrian Trenaman wrote:
>>>> Hi there,
>>>>
>>>> I *think* your problem may be related to the fact that your route 
>>>> does not set an out message on the exchange: the file component is 
>>>> working to a 'InOnly' MEP while the CXF component is working in 
>>>> 'InOut' MEP.
>>>>
>>>> Maybe add a processoe after your 'to' that sets a response?
>>>>
>>>> /Ade
>>>>
>>>> ----- Original Message -----
>>>> From: Alexandros Karypidis <akarypid@yahoo.gr>
>>>> To: users@camel.apache.org <users@camel.apache.org>
>>>> Sent: Sun Nov 22 16:41:37 2009
>>>> Subject: Newbiew: from(cxf).to(file) doesn't work
>>>>
>>>> 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