Hi

Yeah it sounds like a bug about the 404 vs 405. Feel free to log a JIRA ticket
http://camel.apache.org/support

On Wed, Jul 30, 2014 at 7:36 PM, sandp <[email protected]> wrote:
> *Restlet Questions:*
>
> As I understand, RestletOperationException is thrown only when produced to
> an endpoint with restlet. I'm trying to consume from a endpoint through
> restlet component, and facing the issues below:
>
>
> 1. First issue :  Posted to the users.
> <http://camel.465427.n5.nabble.com/Camel-Restlet-2-13-1-working-for-invalid-URL-valid-URL-some-junk-tt5754607.html>
>
> 2. Consider the route below :
> *from("restlet:http://host:somePort/app/users?restletMethods=get,head";)*
> .to("mybatis:userMapper.getUsers?statementType=SelectList")
>                  .process( new CamelRestletResponseProcessor())
>                  .marshal(jaxbDataFormat)
>                   .convertBodyTo(String.class).process(new DataProcessor())
>                 .end();
>
> As show in the route above, the endpoint services  HTTP *get* and* head *
> methods only, if I did a *post* to the endpoint, I'm expecting the ability
> to catch an exception, build a custom response  object and send it in
> response to the calling client.
>
> I tried, catching RestletOperationException, ResourceException, Exception,
> RuntimeException but none matched. *How do I handle the situation?*
>
> 3. For the post above, I get a status code 404 Not Found, but I believe the
> status code should be 405 Method Not Allowed
>
> 4. The client set the Accept and Content-Type headers to empty , yet the
> request went through (header log below). How does camel-restlet component
> handle scenarios where the client skips mandatory headers? For example
> Accept, content-type, Accept-Encoding, or may be some other mandatory
> headers that the consumer must intelligently understand to process the
> request and on failure generate valid HTTP status code?
>
> *Header Log*
> processing getHeaders {CamelHttpMethod=GET,
> org.restlet.startTime=1406739538810, org.restlet.http.headers=[[Host:
> localhost:8091], [User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:30.0)
> Gecko/20100101 Firefox/30.0], [Accept-Language: en-US,en;q=0.5],
> [Accept-Encoding: gzip,deflate], [Connection: keep-alive]],
> CamelHttpUri=http://localhost:8091/cts-rest/cts/users,
> CamelRestletRequest=GET http://localhost:8091/cts-rest/cts/users HTTP/1.1,
> breadcrumbId=ID-sporeddy-50976-1406739527918-0-1,
> CamelRestletResponse=HTTP/1.1 - OK (200) - The request has succeeded}
>
>
>
> Below is a RESTFul root resource method ( that I'm trying to substitute with
> restlet  as a consumer), practically the server responds with a valid HTTP
> status code if the path (URI) requested or  mime type sent by the  client is
> not valid based on the annotations on the method, . Similarly how can I
> achieve the same from camel consumer?
>
>         @Path(RestConstants.USERS)
>         @GET
>         @Cache(maxAge=10)
>         @ValidateResponseWithSchema
>         *@Produces({RestConstants.APPLICATION_OTHER_XML, 
> MediaType.APPLICATION_XML
> })
>         @Consumes({ RestConstants.APPLICATION_OTHER_XML, 
> MediaType.APPLICATION_XML
> })*
>         public Response getUserList();
>
>
>
>
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Camel-Restlet-2-13-1-Consumer-Questions-tp5754698.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: [email protected]
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/

Reply via email to