Support for xml, json, protobuf and Java Object Model retention

67 views
Skip to first unread message

Meghana

unread,
Feb 23, 2012, 12:40:43 PM2/23/12
to Protocol Buffers
Hi,

I am trying to implement protobuf for a REST Jersey application.
Currently, we use XML and JSON serialization provided by the Jersey
framework. So, the only thing we need to do is set the correct mime-
type.

As far as my knowledge goes, the only way to be able to accomodate all
three types would be to write MessageBodyReader/Writer that translate
protobuf to XML and JSON and vice versa. This seems redundant to me
since the Jersey framework already does XML and JSON serialization
automatically. Is there a better way of achieving this?

Also, we already have an object model defined in Java and would like
to continue using the same model in the rest of the application. Is it
possible to retain this model and not use the auto-generated entities
for passing objects back and forth from the application?

Thanks,
Meghana.

Anthony

unread,
Feb 29, 2012, 4:24:15 PM2/29/12
to Protocol Buffers
Hi,

I'm trying a similar thing with trying to support Protobuffer for
XINS (an open source web framework that also support different
protocols). What I'd like to do is to parse a message and generate
the output without the need to compile a .proto file. I'm looking at
DynamicMessage but I can't find out how to parse a message or create a
DynamicMessage.

Please Google use the -use option of the javadoc to see how to create
all the final classes that don't have constructors.

Regards,
Anthony
Reply all
Reply to author
Forward
0 new messages