There is no straight forward way since there is no protobuf-jaxb binding. json works because of the json-jaxb binding provided by the container.
You can easily get protobuf/json/xml working by adding the Providers for the same which use a protobuf-xml-protobuf /protobuf-json-protobuf converter and thus work with all the 3 mime-types without having alternate flows. Let me know in case you need example code. You can use https://github.com/sijuv/protobuf-codec to do the necessary conversions. On Wed, Jan 5, 2011 at 3:16 PM, Meghana <[email protected]>wrote: > Hi, > > I was wondering if there is a way to accomodate for both protobuf and > xml and json when using protocol buffers with the Jersey's REST > framework. > I tried using the protobuf-java-format (http://code.google.com/p/ > protobuf-java-format) which accomodates both use of xml, etc. along > with protobuf. The problem though is that Proto's MessageBodyReader/ > Writer need to support the other MIME types (xml, json) as well. This > seems unnecessary considering Jersey has this build into the framework > already. > If there is some straight forward way of achieving the same, I would > be very interested in knowing about it. > > Thanks. > Meghana. > > -- > You received this message because you are subscribed to the Google Groups > "Protocol Buffers" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]<protobuf%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/protobuf?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Protocol Buffers" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/protobuf?hl=en.
