3 Replies Latest reply on Sep 6, 2011 10:55 AM by Claus Ibsen

    REST and camel

    Jochen Lauer Apprentice

      Hello togehter,

       

      how can I use a REST service and camel to handle all requests within a camel route ?

       

      I tried it like this

       

      <camelContext xmlns="http://camel.apache.org/schema/spring" id="camel">
          <route>
              <from uri="cxfrs://bean://rsServer"></from>
              <choice>
                  <when>
                      <simple>${in.header.CamelHttpMethod} = 'GET'</simple>
                      <to uri="log:##################################### PUT"></to>
                  </when>
                  <when>
                      <simple>${in.header.CamelHttpMethod} = 'PUT'</simple>
                      <to uri="log:##################################### PUT"></to>
                  </when>
                  <when>
                      <simple>${in.header.CamelHttpMethod} = 'POST'</simple>
                      <to uri="log:##################################### POST"></to>
                  </when>
                  <when>
                      <simple>${in.header.CamelHttpMethod} = 'DELETE'</simple>
                      <to uri="log:##################################### DELETE"></to>
                  </when>
                  <otherwise>
                      <to uri="log:##################################### ERROR"></to>
                  </otherwise>
              </choice>
          </route>
      </camelContext>
      

       

      but I failed

       

      Thanks

      labo