No extra detail found in web service response entity when an error occurs
I have a restlet web service. When the client requests some data from the web service, sometimes that data is missing unexpectedly so I return a 404 (maybe it should be 500) error - and I would like to add some extra detail along with the reponse. This would be good for the client application to use to diagnose problems/faults etc. Looking up the official documentation at Restlet, it says the following: "a description can be added to the status report to help the client understand the situation and correct its request if needed. For this purpose, you can create new instances of the Status class instead of using the constants or, more simply, you can use response.setStatus(Status.CLIENT_ERROR_NOT_FOUND, "Your comment goes here")." I was expecting to see "Your comment goes here" somewhere in the response entity but there was nothing (I'm using Fiddler with IE to examine the response entity). Can anyone point out what I might be doing wrong here? -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2730917
Handling different attributes in the same resource class
I have a class that extends Resource - it handles GET and POST requests. For the GET reqeust it uses a passed in attribute from the client - e.g. myuri/{status} everything works ok. However I thought about handling a PUT request in the same class but this time it would use a different value an id: myuri/{id} However it seems that I can't have a variable amount of attributes passed to a resource i.e. having this code causes an error: status = (String) request.getAttributes().get("status"); id = (String) request.getAttributes().get("id"); It seems like you can only get attributes one time only from only one kind of URI- you can't have various URIs with different paramaters routed to the same class i.e.: router.attach("/myuri/{status}", foo.class); //GET router.attach("/myuri/{id}", foo.class); //PUT Am I right in my thinking here? -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2364867
Comprehensive Instructions for all things WADL
Can someone please post some comprehensive instuctions on how you implement WADL for your webservice and how this can be discovered by a browser - I know it has something to do with TunnelService - but I have no idea how to implement it as I only have API docs to go by. I think generally we need more tutorials on the Restlet website to do key stuff! -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=1878799
RE: At the root of my webservice - what's best practice
Can admin delete this as I double posted by mistake - thanks. -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=1862458
Best Practice regarding root/home page of web service
At the root of my web service there is no resource attached - so it just returns a 404 error in the browser - nothing is returned from the GET response - what would you commonly have at the root of your web application - a nice HTML human readable page explaining that you are at the home of the webservice and heres a list of stuff you can do with it??? Or just nothing at all? Should you use WADL here ?? BTW - I am expecting the public to discover the service and they need to know how to use it at a technical level. How have you set yours up? Any help on best practice here would be helpful. Cheers Simon. -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=1861272
RE: Re: RE: Unable to cleanly undeploy restlet application from servlet container
Has this issue been cleared up with the latest version of Restlet yet - as I am getting the same behaviour happening with Tomcat. I am always left with Restlet jars being left behind. -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=1846166
REST web service accepting a POST using Restlet - Best Practice
I have my resource and they typical overridden method to handle POST requests. public void acceptRepresentation(Representation rep) { if (MediaType.APPLICATION_XML.equals(rep.getMediaType())) { //Do stuff here } else { //complain! } } What I want to know is the best practice to handle my packet of XML. I see a lot of examples using a Form - but surely there is a way to work with the Representation object itself or cast it to some useful XML object??? Any help on how you should and do parse incoming XML in your resource is much appreciated. -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=1023840
Tutorial Missing Info
At this point in the tutorial: http://www.restlet.org/documentation/1.0/firstResource#part07 where it says: "This client application must be run as a standalone Java application using a couple of JARs: * org.restlet.jar * com.noelios.restlet.jar * com.noelios.restlet.ext.httpclient.jar * org.apache.commons.httpclient.jar" it has missed out some jars that seem to be crucial in getting the server to work properly - nameley: org.apache.commons.logging.jar org.apache.commons.codec.jar - just thought the docs should be updated to show that you need to include these jars too. Cheers Simon -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=978983