Re: Working with encoded object representations
Jim, you may have notice that the constructor with Representation parameter of the ObjectRepresentation class does not work well. The serialized representation was not correctly handled. This has been fixed in the svn repository and will available in the next 1.0.1 release of the project. Best regards, Thierry Boileau Hi Jim, If you use an Application on your server, the DecoderService associated with your Application should handle this automatically. If you need to handle this decoding manually, use the com.noelios.restlet.application.DecodeRepresentation class and do something like: Representation decodedInput = new DecodeRepresentation(input); Object myObject = new ObjectRepresentation(decodedInput).getObject(); If you want to automate this process, you can specialize your Application's ConverterService.toObject() method and then just invoke myRequest.getEntityAsObject(); BTW, thanks for the nice note [1] in the O'Reilly blog! Best regards, Jerome [1] http://www.oreillynet.com/onjava/blog/2007/04/restlets_for_all.html -Message d'origine- De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] De la part de Jim Alateras Envoyé : mercredi 18 avril 2007 03:06 À : discuss@restlet.tigris.org Objet : Working with encoded object representations I am able to use the client side code to post a gzip representation of a resource. Fundamentally, it is an ObjectRepresentation wrapped in an EncodeRepresentation. This all seems to work fine and gets routed to the correct resource on my server. I am currently trying to find how to handle the representation on the server side and extract the Serializable object in the ObjectRepresentation. Is anyone able to point me in the right direction. cheers
RE: Working with encoded object representations
Hi Jim, If you use an Application on your server, the DecoderService associated with your Application should handle this automatically. If you need to handle this decoding manually, use the com.noelios.restlet.application.DecodeRepresentation class and do something like: Representation decodedInput = new DecodeRepresentation(input); Object myObject = new ObjectRepresentation(decodedInput).getObject(); If you want to automate this process, you can specialize your Application's ConverterService.toObject() method and then just invoke myRequest.getEntityAsObject(); BTW, thanks for the nice note [1] in the O'Reilly blog! Best regards, Jerome [1] http://www.oreillynet.com/onjava/blog/2007/04/restlets_for_all.html > -Message d'origine- > De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] De la > part de Jim Alateras > Envoyé : mercredi 18 avril 2007 03:06 > À : discuss@restlet.tigris.org > Objet : Working with encoded object representations > > I am able to use the client side code to post a gzip > representation of a resource. Fundamentally, it is an > ObjectRepresentation wrapped in an EncodeRepresentation. This > all seems to work fine and gets routed to the correct > resource on my server. I am currently trying to find how to > handle the representation on the server side and extract the > Serializable object in the ObjectRepresentation. > > Is anyone able to point me in the right direction. > > cheers > >
Working with encoded object representations
I am able to use the client side code to post a gzip representation of a resource. Fundamentally, it is an ObjectRepresentation wrapped in an EncodeRepresentation. This all seems to work fine and gets routed to the correct resource on my server. I am currently trying to find how to handle the representation on the server side and extract the Serializable object in the ObjectRepresentation. Is anyone able to point me in the right direction. cheers