Taking an example from Paul:
@ProduceMime("application/vnd.blinksale+xml")
@HttpMethod
Invoices getInvoices() {
// ...
}
As Paul wrote, this assumes the "Invoices" JAXB bean has been created.
Some questions:
- Does this mean there can only be one XML "serialization" of
"Invoices"?
- How do I provide an alternative format, let's say JSON, YAML or HTML?
- Is there a way around the slightly strange "Invoices" JAXB bean,
i.e. can I have an InvoicesResource and a class Invoice, but avoid
"Invoices"?
I believe we probably need some way for a "dual dispatch" style of
consuming and producing a representation from an object, based on the
Java type *and* the MIME content type - i.e. there may be more than
one content type for a given Java type, and more than one Java type
for a given content type. I don't believe the current proposal
addresses this?
Stefan
P.S.: This is not my original idea; credit is due to Spring Web
Services creator Arjen Poutsma. Just for the record ;-)
--
Stefan Tilkov, http://www.innoq.com/blog/st/