Hi everyone,
I have an app that use Restlet 2m2. To have a better live, I have wriited my own "DomListRepresentation" that extends "DomRepresentation" and use reflexion to respond an XML list.
I have alos writed a "JAXBRepresentation" that use JAXB to marsahll an object and respond the resulting XML. And now I'm an happy developper who like Restlet.
But some of my services receive XML (result of JAXB marshalling on the client side). And in each of these services I will do the JAXB unmarshalling from the received representation :
"context.createUnmarshaller().unmarshal(representation.getStream());"
But I wonder if it is a way to receive a custom Representation ?
I will be a more happy developper if I can receive a custom "JAXBRepresentation" insted of an "InputRepresentation".
Is it a way to use custom representations in POST methods ?
Maybe something like that :
# public class MyResource extends ServerResource {
# protected void int() {
# getRepresentations().put(Method.POST, new MyJAXBRepresentation(My.class));
# }
#
# protected Representation post(Representation rep, Varinat v) {
# My obj = ((MyJAXBRepresentation) rep).getObject()
# }
# }
------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2415088