Status: New
Owner: [email protected]
Labels: Type-Defect Priority-Medium

New issue 219 by zoran.rajic: MTOM with Protocol Buffers
http://code.google.com/p/protobuf/issues/detail?id=219

I was wondering if you guys plan to implement the SOAP/MTOM and XML+XOP -like extension on top of PB's.

I came to realize that the Protocol Buffers can very efficiently replace the XML part of the SOAP message, but PB's can't handle large binary attachments coming with the same payload (or, the XOP equivalent -- see http://www.w3.org/TR/xop10/).

The Developer's Guide and http://code.google.com/apis/protocolbuffers/docs/techniques.html#large-data article suggests that the PB should be used only to replace the XML, and not deal with the binary attachments. Based on this, one could potentially combine the MIME and protobuf to handle the binary attachments (similar to what XML+XOP does), ie:

| MIME-Version: 1.0
| Content-Type: Multipart/Related; boundary=MIME_boundary
|
| --MIME_boundary
| Content-Type: x-protobuf
| Content-Transfer-Encoding: binary
|
| // binary encoded equivalent of
| person {
|   name: "John Doe"
|   email: "[email protected]"
|   photo: "cid:http://example.org/me.png";
| }
|
| --MIME_boundary
| Content-Type: image/png
| Content-Transfer-Encoding: binary
| Content-ID: <http://example.org/me.png>
|
| // binary octets for png
| --MIME_boundary--

Unfortunately, even when this seems technically feasible, I find it that it would be contradictory to the Protocol Buffers design principles - the reason why one would consider moving away from XML and into PB's is likely because of the efficiency, and here we'd use inefficient MIME to handle multiple parts of the message.

The PB's "mutipart/multimessage issue" has been brought up on a number of articles, and I understand that the general recommendation is to prefix the segments with a size, and use size/offset -constrained CodedInputStream(), or alternatively something like this: http://efreedom.com/Question/1-1681263/Using-GPB-Make-Wrapper-Classes-Stop-Accepting-Binary-Messages-Meant

Looking at the ideal solution to implement MTOM, we could consider introducing the "iostream" data-type into the PBs to accept and handle the data streams for the binary attachments. I believe that there was already some discussion about reusing the ByteString() for the similar purpose (see http://groups.google.com/group/protobuf/browse_thread/thread/abd65bfadb8b3439)

So, back to the original question - would anyone care to comment if the Protocol Buffers should have the MTOM-equivalent feature?

Thanks,
        Zoran

--
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.

Reply via email to