XML-binary Optimized Packaging
   HOME

TheInfoList



OR:

XML-binary Optimized Packaging (XOP) is a mechanism defined for the serialization of
XML Information Set XML Information Set (XML Infoset) is a W3C recommendation, W3C specification describing an abstract data model of an XML document in terms of a set of ''information items''. The definitions in the XML Information Set specification are meant to be u ...
s (''infosets'') that contain
binary Binary may refer to: Science and technology Mathematics * Binary number, a representation of numbers using only two digits (0 and 1) * Binary function, a function that takes two arguments * Binary operation, a mathematical operation that ta ...
data, as well as deserialization back into the XML Information Set.


Benefits

XOP allows the binary data part of an XML Infoset to be serialized without going through the XML serializer. The XML serialization of an XML Infoset is text based, so any binary data will need to be encoded using
base64 In computer programming, Base64 is a group of binary-to-text encoding schemes that represent binary data (more specifically, a sequence of 8-bit bytes) in sequences of 24 bits that can be represented by four 6-bit Base64 digits. Common to all bina ...
. Using XOP avoids this by extracting the binary data out of the XML Infoset so that the XML Infoset does not contain binary data and the binary data can be serialized differently. Therefore, XOP can reduce the size of the serialization (since base64 encoding has approximately a 33% size overhead) and (depending on how it is implemented) might allow processing efficiencies. This size increase results in extra resources needed to transmit or store the data.


Costs

XOP introduces another level of processing. Therefore, it introduces extra complexity and processing overheads. The representation of the XOP packages introduces some overhead. These are negligible when the binary data is large, but could be significant if the binary data is small.


Operation

XOP operates on a single XML Infoset. The binary parts of the original XML infoset are extracted out, leaving an "XOP Infoset" (which is essentially the original XML Infoset with the binary parts replaced by external references). The references in the XOP Infoset are represented using the "xop:Include" element. The XOP Infoset plus the extracted content can be serialized into a representation called the "XOP Package". The XOP Package can be sent or stored. To reconstitute the XML Infoset, the XOP Package is deserialized into the XOP Infoset plus the extracted content, and then the extracted content is put back into the XML Infoset.


XOP Packages

XOP can be used with a number of different packaging mechanisms. A packaging mechanism defines how the XOP Infoset and the binary chunks are represented. The XOP specification defines how
MIME Multipurpose Internet Mail Extensions (MIME) is an Internet standard that extends the format of email messages to support text in character sets other than ASCII, as well as attachments of audio, video, images, and application programs. Message ...
can be used as a packaging mechanism. When used with MIME, the XOP Infoset is represented as XML in the root MIME part, and the binary chunks are represented in the other MIME parts. Those other MIME parts can be serialized as binary data, avoiding the need to base64 encode them if they were left inside the XML Infoset. XOP does not mandate the use of the MIME packaging mechanism, so other packaging mechanisms could be used.


Usage in SOAP Web services

The MIME packaging mechanism is the most widely used, since XOP is usually used to represent
SOAP Soap is a salt of a fatty acid used in a variety of cleansing and lubricating products. In a domestic setting, soaps are surfactants usually used for washing, bathing, and other types of housekeeping. In industrial settings, soaps are use ...
messages with MTOM. For example:


See also

* MTOM (Message Transmission Optimization Mechanism)


References


XML-Binary Optimized Packaging
(article from Dr Dobbs)


External links


W3C's XML-binary Optimized Packaging
W3C Recommendation {{W3C standards XML-based standards