Return-Path: Delivered-To: apmail-camel-users-archive@www.apache.org Received: (qmail 56571 invoked from network); 7 Jan 2010 00:36:02 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 7 Jan 2010 00:36:02 -0000 Received: (qmail 69543 invoked by uid 500); 7 Jan 2010 00:36:01 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 69506 invoked by uid 500); 7 Jan 2010 00:36:01 -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 Received: (qmail 69496 invoked by uid 99); 7 Jan 2010 00:36:01 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Jan 2010 00:36:01 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of steve.gargan@gmail.com designates 209.85.219.227 as permitted sender) Received: from [209.85.219.227] (HELO mail-ew0-f227.google.com) (209.85.219.227) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Jan 2010 00:35:53 +0000 Received: by ewy27 with SMTP id 27so6777246ewy.36 for ; Wed, 06 Jan 2010 16:35:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=soQWzX3tTyaVMMm9myqNs+//Px1GzfUEwZiNzggwT64=; b=a74EZoivK3m4/V8PSQMq543RlZrP5wLVJBFVZg7saRqQJVMGKcirGxN39jAKhNfcOe ehvQeQuoqD1b+5xyacI3tl1NZlaZIfIZdm+SvHyhRLmhmViNuHWnVP7gWoBOmQTVcnT5 LMkPQLlMcmKWsV+7hUl+7+HaZNqvAJFMTT6yA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=dVzaIYCQiOW25swSU3u/g6RuOA5NNgYSWRNAJ+JSwIZSddvpV1OTaMtAv8dGrJFRp0 sg7Naw2isMjpWsewlmm1xESubfeXvobeN21EJx6XERgKe1Diiso4BF38SsQiYhh8iZkJ 0NjMj0kgUIpErD3UlTY3yzbUT8Lrb+U/btjtk= MIME-Version: 1.0 Received: by 10.213.2.84 with SMTP id 20mr9795111ebi.46.1262824532079; Wed, 06 Jan 2010 16:35:32 -0800 (PST) In-Reply-To: <27026992.post@talk.nabble.com> References: <26896366.post@talk.nabble.com> <55f2e4a80912221705j42597b7cg260eb3a4016a68d9@mail.gmail.com> <27026992.post@talk.nabble.com> Date: Wed, 6 Jan 2010 16:35:32 -0800 Message-ID: <55f2e4a81001061635y31198164i1d54b77676db3a38@mail.gmail.com> Subject: Re: ActiveMQ - Camel as client POST? From: Stephen Gargan To: users@camel.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable No the JsonDataFormat does not set the content type you'll need to do that yourself. Try specifying the content type explicitly from("direct:simple-http-send").marshal().json().setHeader(Exchange.CONTENT= _TYPE, constant("application/json")).to("http://host:port/service") use what ever mime type your service is expecting. There is more info here.... http://camel.apache.org/http.html Give this a shot. ste On Wed, Jan 6, 2010 at 4:09 PM, user09772 wrote: > > I had the xstream depend. missing. > > Although I'm unable to POST to a simple Jersey service. > > Doing this in the camel config: > from("direct:simple-http-send").marshal().json().to("http://host:port/ser= vice"); > > In the consumer: > ProducerTemplate producerTemplate =3D camelContext.createProducerTemplate= (); > producerTemplate.sendBody("direct:simple-http-send", sendObj); > > > Getting the following exception now: > > Caused by: org.apache.camel.component.http.HttpOperationFailedException: > HTTP operation failed invoking http://host:port/service with statusCode: = 415 > =A0 =A0 =A0 =A0at > org.apache.camel.component.http.HttpProducer.populateHttpOperationFailedE= xception(HttpProducer.java:150) > =A0 =A0 =A0 =A0at > org.apache.camel.component.http.HttpProducer.process(HttpProducer.java:92= ) > =A0 =A0 =A0 =A0at > org.apache.camel.processor.SendProcessor$1.doInProducer(SendProcessor.jav= a:97) > =A0 =A0 =A0 =A0at > org.apache.camel.processor.SendProcessor$1.doInProducer(SendProcessor.jav= a:95) > =A0 =A0 =A0 =A0at > org.apache.camel.impl.ProducerCache.doInProducer(ProducerCache.java:146) > =A0 =A0 =A0 =A0at > org.apache.camel.processor.SendProcessor.doProcess(SendProcessor.java:94) > =A0 =A0 =A0 =A0at > org.apache.camel.processor.SendProcessor.process(SendProcessor.java:82) > =A0 =A0 =A0 =A0at > org.apache.camel.management.InstrumentationProcessor.process(Instrumentat= ionProcessor.java:67) > =A0 =A0 =A0 =A0at > org.apache.camel.processor.DelegateProcessor.processNext(DelegateProcesso= r.java:53) > =A0 =A0 =A0 =A0at > org.apache.camel.processor.DelegateProcessor.proceed(DelegateProcessor.ja= va:82) > =A0 =A0 =A0 =A0at > org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInte= rceptor.java:93) > =A0 =A0 =A0 =A0at > org.apache.camel.management.InstrumentationProcessor.process(Instrumentat= ionProcessor.java:67) > =A0 =A0 =A0 =A0at > org.apache.camel.processor.RedeliveryErrorHandler.processExchange(Redeliv= eryErrorHandler.java:223) > =A0 =A0 =A0 =A0at > org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(Red= eliveryErrorHandler.java:153) > =A0 =A0 =A0 =A0at > org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryError= Handler.java:91) > =A0 =A0 =A0 =A0at > org.apache.camel.processor.DefaultErrorHandler.process(DefaultErrorHandle= r.java:49) > =A0 =A0 =A0 =A0at > org.apache.camel.processor.DefaultChannel.process(DefaultChannel.java:206= ) > =A0 =A0 =A0 =A0at org.apache.camel.processor.Pipeline.process(Pipeline.ja= va:74) > =A0 =A0 =A0 =A0at > org.apache.camel.processor.UnitOfWorkProcessor.processNext(UnitOfWorkProc= essor.java:54) > =A0 =A0 =A0 =A0at > org.apache.camel.processor.DelegateProcessor.process(DelegateProcessor.ja= va:48) > =A0 =A0 =A0 =A0at > org.apache.camel.management.InstrumentationProcessor.process(Instrumentat= ionProcessor.java:67) > =A0 =A0 =A0 =A0at > org.apache.camel.component.direct.DirectProducer.process(DirectProducer.j= ava:45) > =A0 =A0 =A0 =A0at > org.apache.camel.impl.ProducerCache$1.doInProducer(ProducerCache.java:179= ) > =A0 =A0 =A0 =A0at > org.apache.camel.impl.ProducerCache$1.doInProducer(ProducerCache.java:161= ) > =A0 =A0 =A0 =A0at > org.apache.camel.impl.ProducerCache.doInProducer(ProducerCache.java:146) > =A0 =A0 =A0 =A0at > org.apache.camel.impl.ProducerCache.sendExchange(ProducerCache.java:160) > =A0 =A0 =A0 =A0at org.apache.camel.impl.ProducerCache.send(ProducerCache.= java:98) > =A0 =A0 =A0 =A0at > org.apache.camel.impl.DefaultProducerTemplate.send(DefaultProducerTemplat= e.java:97) > =A0 =A0 =A0 =A0at > org.apache.camel.impl.DefaultProducerTemplate.sendBody(DefaultProducerTem= plate.java:110) > =A0 =A0 =A0 =A0... 27 more > > > > > > > This would happen if i didn't indicate a content-type, but I'm assuming > marshal().json() =A0would do this for me. =A0Any Ideas? > > Thanks. > -- > View this message in context: http://old.nabble.com/ActiveMQ---Camel-as-c= lient-POST--tp26896366p27026992.html > Sent from the Camel - Users mailing list archive at Nabble.com. > >