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

    REST and camel

    labo32_delaboe

      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