You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by "Lorenz, Stefan" <St...@htw-aalen.de> on 2010/10/22 11:07:41 UTC

Best way to recive data from an http endpoint?

Hi,
 
I'm trying to get data from a web service.
I tried it with the ConsumerTemplate and just using
consumer.receiveBody("http://foo/?query=bar... <http://foo/?query=bar> ")
this is working but there I got an error because of the whitespaces in the
query parameter...
I have encoded them correctly...
so is there another way to do that?

Mit freundlichen Grüßen / kind regards

 

Stefan Lorenz

wissenschaftlicher Mitarbeiter

 

 



 

Hochschule Aalen / Aalen University
Fakultät Elektronik und Informatik
Anton-Huber-Strasse 25 

73430 Aalen


E-Mail:  stefan.lorenz@htw-aalen.de
Internet:       www.htw-aalen.de <http://www.htw-aalen.de/> 

 

AW: Best way to recive data from an http endpoint?

Posted by "Lorenz, Stefan" <St...@htw-aalen.de>.
Thx, 
I got it working now.
I've created a route with an http component inside... 

-----Ursprüngliche Nachricht-----
Von: Jean-Baptiste Onofré [mailto:jb@nanthrax.net] 
Gesendet: Freitag, 22. Oktober 2010 11:21
An: users@camel.apache.org
Betreff: Re: Best way to recive data from an http endpoint?

Hi Stefan,

When you say "get data from a web service", does it mean that you want that
Camel act as a consumer, binding a HTTP endpoint expecting incoming SOAP
message or Camel act as a provider and communicates with an "external"
WebService ?

I guess it's the first behavior: Camel as a consumer.

You can do it using camel-cxf or camel-jetty components.

For example, using camel-cxf, you can define something like:

      <cxf:cxfEndpoint id="serviceEndpoint" 
address="http://localhost:9000/SoapContext/SoapPort"
      		wsdlURL="testutils/hello_world.wsdl"
      		serviceClass="org.apache.hello_world_soap_http.Greeter"
      		endpointName="s:SoapPort"
      		serviceName="s:SOAPService"
      	xmlns:s="http://apache.org/hello_world_soap_http" />
      <camelContext id="camel" 
xmlns="http://activemq.apache.org/camel/schema/spring">
        <route>
          <from uri="cxf:bean:routerEndpoint" />
          <to uri="cxf:bean:serviceEndpoint" />
        </route>
     </camelContext>

Camel uses Apache CXF to "expose" a WebService and waiting for incoming SOAP
messages.

Regards
JB


On 10/22/2010 11:07 AM, Lorenz, Stefan wrote:
> Hi,
> I'm trying to get data from a web service.
> I tried it with the ConsumerTemplate and just using 
> consumer.receiveBody("http://foo/?query=bar... 
> <http://foo/?query=bar>") this is working but there I got an error 
> because of the whitespaces in the query parameter...
> I have encoded them correctly...
> so is there another way to do that?
>
> Mit freundlichen Grüßen / kind regards
>
> Stefan Lorenz
>
> wissenschaftlicher Mitarbeiter
>
> Hochschule Aalen / Aalen University
> Fakultät Elektronik und Informatik
> Anton-Huber-Strasse 25
>
> 73430 Aalen
>
> E-Mail: stefan.lorenz@htw-aalen.de <ma...@htw-aalen.de>
> Internet: www.htw-aalen.de <http://www.htw-aalen.de/>
>

Re: Best way to recive data from an http endpoint?

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi Stefan,

When you say "get data from a web service", does it mean that you want 
that Camel act as a consumer, binding a HTTP endpoint expecting incoming 
SOAP message or Camel act as a provider and communicates with an 
"external" WebService ?

I guess it's the first behavior: Camel as a consumer.

You can do it using camel-cxf or camel-jetty components.

For example, using camel-cxf, you can define something like:

      <cxf:cxfEndpoint id="serviceEndpoint" 
address="http://localhost:9000/SoapContext/SoapPort"
      		wsdlURL="testutils/hello_world.wsdl"
      		serviceClass="org.apache.hello_world_soap_http.Greeter"
      		endpointName="s:SoapPort"
      		serviceName="s:SOAPService"
      	xmlns:s="http://apache.org/hello_world_soap_http" />
      <camelContext id="camel" 
xmlns="http://activemq.apache.org/camel/schema/spring">
        <route>
          <from uri="cxf:bean:routerEndpoint" />
          <to uri="cxf:bean:serviceEndpoint" />
        </route>
     </camelContext>

Camel uses Apache CXF to "expose" a WebService and waiting for incoming 
SOAP messages.

Regards
JB


On 10/22/2010 11:07 AM, Lorenz, Stefan wrote:
> Hi,
> I'm trying to get data from a web service.
> I tried it with the ConsumerTemplate and just using
> consumer.receiveBody("http://foo/?query=bar... <http://foo/?query=bar>")
> this is working but there I got an error because of the whitespaces in
> the query parameter...
> I have encoded them correctly...
> so is there another way to do that?
>
> Mit freundlichen Grüßen / kind regards
>
> Stefan Lorenz
>
> wissenschaftlicher Mitarbeiter
>
> Hochschule Aalen / Aalen University
> Fakultät Elektronik und Informatik
> Anton-Huber-Strasse 25
>
> 73430 Aalen
>
> E-Mail: stefan.lorenz@htw-aalen.de <ma...@htw-aalen.de>
> Internet: www.htw-aalen.de <http://www.htw-aalen.de/>
>