camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tracy Snell <tsn...@gmail.com>
Subject Re: Invoking remote RESTful services urgent !!
Date Tue, 01 Oct 2013 17:31:18 GMT
Here's code I use to expose a REST url externally to an internal REST service.

        from(BASE_URI + "/doctor?bindingStyle=SimpleConsumer&resourceClasses=" + DoctorLookupService.class.getName())
          .setHeader(Exchange.HTTP_URI,
                 simple("http://my.company.com/CT/GetContact.svc/npi/${header.npi}"))
            .setHeader("Authorization", simple("Basic foobarred="))
            .setHeader("CamelHttpPath", simple(""))
            .to("http://igetoverridden.com?throwExceptionOnFailure=false");

Just use the http(4) component and set the appropriate URL. In my case it's dynamic so I stuff
it in the header and that overrides the one in the .to

On Sep 30, 2013, at 1:49 PM, vjboston <vjboston@gmail.com> wrote:

> 
> Can somebody share a sample code for invoking an remote restful service.
> I tried it with following code 


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message