Hi JR, The automatic conversion is done via the ConverterService mechanism. Our XStream extension can take care of the automatic XML or JSON serialization. I've updated the wiki page: http://wiki.restlet.org/docs_2.0/13-restlet/27-restlet/285-restlet.html
This ensures that your service is fully interoperable. You could definitely use something else than Restlet on the client side or on the server side. Regarding statuses, there are accessible though the ClientResource#getStatus() method, but we are considering an automatic Status <-> ResourceException mapping feature. See related RFE: "Add exception conversion to ConverterService" http://restlet.tigris.org/issues/show_bug.cgi?id=878 Best regards, Jerome Louvel -- Restlet ~ Founder and Lead developer ~ http://www.restlet.org Noelios Technologies ~ Co-founder ~ http://www.noelios.com -----Message d'origine----- De : JR Shampang [mailto:[email protected]] Envoyé : mardi 25 août 2009 16:57 À : [email protected] Objet : RE: ClientResource Examples? Hi Jerome, Thanks for the info and code samples. I have a few questions, though: How is automatic conversion performed? For example, suppose the Customer resource returned an XML representation on a GET. Where is the conversion from Customer to XML and from XML to Customer defined? Suppose the REST service did not use Restlet to implement its web service. Would I be able to define some custom contract and still use this automatic conversion, even though the server does not formally use that custom annotated interface? What if an HTTP 4xx or 5xx is returned during one of these operations? Is an Exception thrown, or would null be returned in place of a Customer object? ------------------------------------------------------ http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=23871 80 ------------------------------------------------------ http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2387653

