Return-Path: X-Original-To: apmail-camel-users-archive@www.apache.org Delivered-To: apmail-camel-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D6664D72E for ; Tue, 6 Nov 2012 12:08:54 +0000 (UTC) Received: (qmail 51971 invoked by uid 500); 6 Nov 2012 12:08:54 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 51814 invoked by uid 500); 6 Nov 2012 12:08:54 -0000 Mailing-List: contact users-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@camel.apache.org Delivered-To: mailing list users@camel.apache.org Delivered-To: moderator for users@camel.apache.org Received: (qmail 24896 invoked by uid 99); 6 Nov 2012 11:55:20 -0000 X-ASF-Spam-Status: No, hits=4.2 required=5.0 tests=HTML_MESSAGE,NORMAL_HTTP_TO_IP,SPF_NEUTRAL,URI_HEX X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: 216.139.236.26 is neither permitted nor denied by domain of mato.krajcir@gmail.com) Date: Tue, 6 Nov 2012 03:54:54 -0800 (PST) From: martin11 To: users@camel.apache.org Message-ID: <1352202894847-5722212.post@n5.nabble.com> In-Reply-To: References: <1352133826642-5722162.post@n5.nabble.com> Subject: Re: CXFRS Producer MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_5171_4127275.1352202894848" X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_5171_4127275.1352202894848 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hello Willem,thank for your answer. Looks that you have right. Let me describe my situation. I have XML file which I want to use together with freemarker. I already tested my XML to call REST web service from SoapUI tool and it works well.*/ws-read.xml/* template: <?xml version="1.0" encoding="UTF-8"?> ${headers.subject} How can I use my XML template in Camel? Do I need marshal XML to JSON every time before I call CXFRS component? Or is there any way how to use message body in XML format?There is my context: test True POST and I got this exception: [mel-1) thread #0 - timer://foo] XMLSerializer INFO Using default type string{"ws:GetSubjectRequest":{"@xmlns:ws":"http://portal.system.com/ws/WS-READ-1.1","#text":"test"}} [mel-1) thread #0 - timer://foo] BusApplicationContext INFO Refreshing org.apache.cxf.bus.spring.BusApplicationContext@5d106021: startup date [Tue Nov 06 12:38:23 CET 2012]; parent: Root WebApplicationContext[mel-1) thread #0 - timer://foo] idationXmlBeanDefinitionReader INFO Loading XML bean definitions from class path resource [META-INF/cxf/cxf.xml] [mel-1) thread #0 - timer://foo] idationXmlBeanDefinitionReader INFO Loading XML bean definitions from class path resource [META-INF/cxf/camel/cxf-extension-camel.xml] [mel-1) thread #0 - timer://foo] DefaultErrorHandler ERROR Failed delivery for (MessageId: ID-asgard-57144-1352201886004-0-3 on ExchangeId: ID-asgard-57144-1352201886004-0-2). Exhausted after delivery attempt: 1 caught: *java.lang.ClassCastException: java.util.ArrayList cannot be cast to org.apache.cxf.message.MessageContentsList*java.lang.ClassCastException: java.util.ArrayList cannot be cast to org.apache.cxf.message.MessageContentsList at org.apache.camel.component.cxf.jaxrs.DefaultCxfRsBinding.bindCamelMessageBodyToRequestBody(DefaultCxfRsBinding.java:166)[camel-cxf-2.10.2.jar:2.10.2] at org.apache.camel.component.cxf.jaxrs.CxfRsProducer.invokeHttpClient(CxfRsProducer.java:143)[camel-cxf-2.10.2.jar:2.10.2] at org.apache.camel.component.cxf.jaxrs.CxfRsProducer.process(CxfRsProducer.java:87)[camel-cxf-2.10.2.jar:2.10.2] at org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)[camel-core-2.10.2.jar:2.10.2] at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[camel-core-2.10.2.jar:2.10.2] at org.apache.camel.processor.SendProcessor$2.doInAsyncProducer(SendProcessor.java:122)[camel-core-2.10.2.jar:2.10.2] at org.apache.camel.impl.ProducerCache.doInAsyncProducer(ProducerCache.java:298)[camel-core-2.10.2.jar:2.10.2] at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:117)[camel-core-2.10.2.jar:2.10.2] at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[camel-core-2.10.2.jar:2.10.2] at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)[camel-core-2.10.2.jar:2.10.2] How should I set message body and in which format? -- View this message in context: http://camel.465427.n5.nabble.com/CXFRS-Producer-tp5722162p5722212.html Sent from the Camel - Users mailing list archive at Nabble.com. ------=_Part_5171_4127275.1352202894848--