Hi,

You json string message should be added to the body of the Camel Exchange
before to call the HTTPS endpoint

<setBody>
     <constant>YOUR JSON STRING</constant>
</setBody>

Regards,


On Tue, Oct 7, 2014 at 10:30 PM, camelcoder07 <dmhu...@hotmail.com> wrote:

> Hi, I need some help setting up my camel configuration to consume data
> from a
> remote rest web service using camel.  This remote service is https and uses
> api-key for authentication.  I also need to POST to this web service with a
> query as well to get data returned.
>
> I need help with how to pass the query to the POST.  Also if you see
> anything else that could be done cleaner please let me know.
>
> Below is the query that I must pass to the web service:
>
> {
>
>     "sinceTime": time,
>
>     "untilTime": time,
>
>     "timezoneOffset": 0,
>
>     "details": {
>
>         "widgetType": "Place"
>
>     },
>
>     "filters": [
>
>         {
>
>             "dimension": "SOURCE",
>
>             "filterValues": [
>
>                 "Site1",
>
>                 "Site2"
>
>
>
>             ]
>
>         }
>
>     ],
>
>     "metric": "TEST",
>
>     "start": 0,
>
>     "rows": 200
>
> }
>
>
> As a side note I am using JBoss Developer Studio as this will eventually
> run
> in an JBoss environment.
>
> Below is the code that I currently have:
>
> <?xml version="1.0" encoding="UTF-8"?>
>
> <beans xmlns="http://www.springframework.org/schema/beans";
>        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>        xmlns:camel="http://camel.apache.org/schema/spring";
>        xsi:schemaLocation="
>        http://www.springframework.org/schema/beans
> http://www.springframework.org/schema/beans/spring-beans.xsd
>        http://camel.apache.org/schema/spring
> http://camel.apache.org/schema/spring/camel-spring.xsd
>        http://camel.apache.org/schema/spring
> http://camel.apache.org/schema/spring/camel-http.xsd";>
>
>   <camelContext xmlns="http://camel.apache.org/schema/spring";>
>     <route>
>         <from uri="direct:start"/>
>         <setHeader headerName="CamelHttpMethod">
>             <constant>POST</constant>
>         </setHeader>
>         <to
> uri="https://api.host.com/api/v3.1/link/query/place/?apiKey=1234"/>
>         <log message="Message Recieved"/>
>         <to uri="file:target/messages/test"/>
>     </route>
> </camelContext>
> </beans>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Camel-Spring-HTTP-Consumer-using-remote-Rest-web-service-tp5757395.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Charles Moulliard
Apache Committer / Architect @RedHat
Twitter : @cmoulliard | Blog :  http://cmoulliard.github.io

Reply via email to