Example for XOP

"Martin Gudgin" <[email protected]>
Newsgroups gmane.text.xml.distributed
Message-ID <DD35CC66F54D8248B6E04232892B6338FB6067@RED-MSG-43.redmond.corp.microsoft.com>
Attached text file contains a XOP example. It is essentially an edited
version of the example in the PASWA document.

Cheers

Gudge
XOP Example.txt (text/plain, 1.9 KB)
Figure 1 shows an XML Infoset prior to XOP processing. Figure 2 shows the same Infoset, serialized using the XOP format. The base64 character children of the m:photo and m:sig elements have been replaced by a xop:Include element, while the binary octets have been serialized in a seperate MIME part.


Figure 1

<soap:Envelope xmlns:soap='http://www.w3.org/2003/05/soap-envelope' xmlns:xop='http://www.w3.org/2004/01/xop' xmlns:xopmime='http://www.w3.org/2004/01/xop/mime' >
 <soap:Body>
  <m:data xmlns:m='http://example.org/stuff' >
   <m:photo xopmime:content-type='image/png' >
   /aWKKapGGyQ=
   </m:photo>
   <m:sig xopmime:content-type='application/pkcs7-signature' >
   Faa7vROi2VQ=
   </m:sig>
  </m:data>
 </soap:Body>
</soap:Envelope>


Figure 2

MIME-Version: 1.0
Content-Type: Multipart/Related; boundary=MIME_boundary;type=text/xml;start="<[email protected]>"
Content-Description: An XML document with my picture and signature in it

--MIME_boundary
Content-Type: text/xml; charset=UTF-8
Content-Transfer-Encoding: 8bit
Content-ID: <[email protected]>

<soap:Envelope xmlns:soap='http://www.w3.org/2003/05/soap-envelope' xmlns:xop='http://www.w3.org/2004/01/xop' xmlns:xopmime='http://www.w3.org/2004/01/xop/mime' >
 <soap:Body>
  <m:data xmlns:m='http://example.org/stuff' >
   <m:photo xopmime:content-type='image/png' >
    <xop:Include href='cid:http://example.org/me.png' />
   </m:photo>
   <m:sig xopmime:content-type='application/pkcs7-signature' >
    <xbinc:Include href='cid:http://example.org/my.hsh' />
   </m:sig>
  </m:data>
 </soap:Body>
</soap:Envelope>

--MIME_boundary
Content-Type: image/png
Content-Transfer-Encoding: binary
Content-ID: <http://example.org/me.png>

// binary octets for png

--MIME_boundary
Content-Type: application/pkcs7-signature
Content-Transfer-Encoding: binary
Content-ID: <http://example.org/my.hsh>

// binary octets for signature

--MIME_boundary--
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.