Return-Path: Delivered-To: apmail-activemq-camel-user-archive@locus.apache.org Received: (qmail 25799 invoked from network); 28 Dec 2007 07:22:17 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 28 Dec 2007 07:22:17 -0000 Received: (qmail 40613 invoked by uid 500); 28 Dec 2007 07:22:06 -0000 Delivered-To: apmail-activemq-camel-user-archive@activemq.apache.org Received: (qmail 40599 invoked by uid 500); 28 Dec 2007 07:22:06 -0000 Mailing-List: contact camel-user-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: camel-user@activemq.apache.org Delivered-To: mailing list camel-user@activemq.apache.org Received: (qmail 40590 invoked by uid 99); 28 Dec 2007 07:22:05 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 27 Dec 2007 23:22:05 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=MISSING_MID,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of rthullner@gmx.at designates 213.165.64.20 as permitted sender) Received: from [213.165.64.20] (HELO mail.gmx.net) (213.165.64.20) by apache.org (qpsmtpd/0.29) with SMTP; Fri, 28 Dec 2007 07:21:43 +0000 Received: (qmail invoked by alias); 28 Dec 2007 07:21:45 -0000 Received: from M2448P015.adsl.highway.telekom.at (EHLO yoda) [212.183.37.239] by mail.gmx.net (mp057) with SMTP; 28 Dec 2007 08:21:45 +0100 X-Authenticated: #20620228 X-Provags-ID: V01U2FsdGVkX19XSaRpPL5XbZbw2VhPLUkionKP6s6TmsGXKYmqiE j1UyHgnZ+NW36+ From: "Robert Thullner" To: Subject: AW: AW: Call Web Services from Camel Date: Fri, 28 Dec 2007 08:21:39 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Office Outlook, Build 11.0.5510 In-Reply-To: <4774146C.1040406@gmail.com> Thread-Index: AchIzMg8I2gM6m2CQyKq5KN3sXCKTQAVTOcg X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198 X-Y-GMX-Trusted: 0 X-Virus-Checked: Checked by ClamAV on apache.org Message-Id: <20071228072152.24605724968@athena.apache.org> Thanks for your reply.=20 I still have one more question. How do I get the result of the = webservice call into some variable, so that I can pass it to the resultqueue? Does = this happen implicitly? Thanks Robert=20 -----Urspr=FCngliche Nachricht----- Von: Hadrian Zbarcea [mailto:hzbarcea@gmail.com]=20 Gesendet: Donnerstag, 27. Dezember 2007 22:09 An: camel-user@activemq.apache.org Betreff: Re: AW: Call Web Services from Camel Hi Robert, From what you describe, it looks like you just need to call your web services normally from(...) .to(webservice 1) .to(webservice 2) .to(resultQueue); You must have the cxf component and your urls have to point to cxf web services. Taking a look at camel-example-cxf may help. Hadrian Robert Thullner wrote: > Thanks for the reply. > > I looked at both components, but I still have some understanding = problems. > My problem is that I do not know how to trigger the webservice call=20 > from camel. > Usually I have a rule: > > from(...) > .to(...); > > So I wait for an event and write the event to somewhere else. > > My scenario is something like that. > from(...) > .call(webservice 1) > .call(webservice 2) > .to(resultQueue); > > Do you have any tutorials for calling a service within a route? Or=20 > should it be implemented somehow else? > > > > I also tried to get request from a REST webservice and write it the=20 > result to a queue, as the service is called from the browser window. I = > used the jetty component for this, as the HttpComponent cannot be used = > as input component. > > My route looks like this: > from("jetty:http:localhost:8080/restapp-1.0.0/helloworld") > .to("activemq:queue:rest.queue"); > > But when I start the CamelContext I always get an exception (see=20 > below). I have put the camel-http, camel-jetty, jetty, jetty-util and=20 > jetty-xbean jars on my classpath, but there are still some classes=20 > missing. But I could not find any jar file that includes the=20 > HttpClient class. What other jar files do I need to get the = JettyComponent working? > > > The exception is: > Exception in thread "main" java.lang.NoClassDefFoundError: > org/mortbay/jetty/client/HttpClient > at > org.apache.camel.component.jetty.JettyHttpComponent.createHttpClient(J > ettyHt > tpComponent.java:193) > at > org.apache.camel.component.jetty.JettyHttpComponent.doStart(JettyHttpC > ompone > nt.java:187) > at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:51) > at=20 > org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:42 > ) at=20 > org.apache.camel.util.ServiceHelper.startServices(ServiceHelper.java:5 > 3) > at > org.apache.camel.impl.DefaultCamelContext.getComponent(DefaultCamelCon > text.j > ava:149) > at > org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelCont > ext.ja > va:256) > at > org.apache.camel.util.CamelContextHelper.getMandatoryEndpoint(CamelCon > textHe > lper.java:48) > at org.apache.camel.model.RouteType.resolveEndpoint(RouteType.java:89) > at=20 > org.apache.camel.impl.RouteContext.resolveEndpoint(RouteContext.java:8 > 1) at=20 > org.apache.camel.impl.RouteContext.resolveEndpoint(RouteContext.java:9 > 0) at=20 > org.apache.camel.model.FromType.resolveEndpoint(FromType.java:66) > at=20 > org.apache.camel.impl.RouteContext.getEndpoint(RouteContext.java:59) > at org.apache.camel.model.RouteType.addRoutes(RouteType.java:179) > at org.apache.camel.model.RouteType.addRoutes(RouteType.java:80) > at org.apache.camel.model.RouteType.addRoutes(RouteType.java:71) > at > org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(Defaul > tCamel > Context.java:449) > at > org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext. > java:4 > 41) > at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:51) > at eip.status.camel.routes.MessageBroker.main(MessageBroker.java:93) > =20 > > Thanks for help > Robert > > -----Urspr=FCngliche Nachricht----- > Von: Guillaume Nodet [mailto:gnodet@gmail.com] > Gesendet: Donnerstag, 27. Dezember 2007 17:04 > An: camel-user@activemq.apache.org > Betreff: Re: Call Web Services from Camel > > There is a CXF based component that you should be able to use it=20 > provided that you configure it correctly for REST. Else, if you have=20 > problems to do that using the HTTP component, let us know, as it=20 > should be able to work too. > > On Dec 27, 2007 3:45 PM, Robert Thullner wrote: > > =20 >> Hi >> >> Is it possible to invoke Web Services within my CamelContext?=20 >> Especially I want to invoke a REST service and a service implemented=20 >> in >> =20 > CXF or Axis. > =20 >> My scenario is the following: When a jms message is received on a=20 >> queue, the REST service and the Axis service shall be invoked and the = >> results of the two services shall be passed back on some other queue? >> Can this be done by using the Camel HTTP component or is it advisable = >> to just implement the Webservice calling in some Java class? >> For me it would be a nice architecture if I could do the web service=20 >> calling in my camel context, so I could get it out of my Java = classes. >> So my question is if that can be done when using Camel? >> >> Thanks for any suggestions >> Robert >> >> =20 > > > > -- > Cheers, > Guillaume Nodet > ------------------------ > Blog: http://gnodet.blogspot.com/ > > > =20