[xsd-users] XSD, Google Protocol Buffer and Fix Protocol

Boris Kolpackov boris at codesynthesis.com
Fri Apr 6 10:38:03 EDT 2012


Hi Davide,

Davide Anastasia <Davide.Anastasia at qualitycapital.com> writes:

> Question: is it possible to generate C++ classes with XSD from the FIX
> protocol XSD Schema and then plug inside GProto as binary serialization
> engine (in a similar way like the one described for ACE (Adaptive
> Communication Environment) CDR streams in the CS XSD manual).

This will be possible if Protocol Buffers provide support for creating
binary representations programmatically. Or, in other words, instead of
giving Protocol Buffers a class generated from a message specification,
we tell it to write/read int, string, etc.

If that's possible, then you can implement an XSD binary stream on top
of this API as shown in the binary/boost example (there we use the Boost
Serialization library).

Also, if this is not possible directly, then I suppose you could always
define a set of messages each containing a single simple type and then
use those messages as a way to serialize the data. I am not sure how
efficient this will be, however.

Yet another alternative will be to just save the XSD-generated class
into one of the supported binary formats (e.g, XDR, CDR, Boost, or
something custom) and then add that binary as a blob to the message.
It seems this thread discusses this approach:

http://groups.google.com/group/protobuf/browse_thread/thread/abd65bfadb8b3439

Boris



More information about the xsd-users mailing list