OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

search-ws message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: RE: [search-ws] [Issue] Search response can only return XML records


> Currently a record within a Response can only contain an XML record.
> There is no support for non-XML records.

This isn't true. The recordData element can contain any XML structure.
Whilst the immediate content must be an XML element, what happens
underneath that is entirely dependent on the definition of the XML
namespace of that element. It is therefore quite easy to return binary
data using any mechanism you like.

For instance


<record>
  <recordSchema> http://example.org/stuff</recordSchema>
  <recordPacking>xml</recordPacking>
  <recordData>
    <m:data xmlns:m='http://example.org/stuff'>
      <m:photo xmlmime:contentType='image/png'>/aWKKapGGyQ=</m:photo>
      <m:sig
xmlmime:contentType='application/pkcs7-signature'>Faa7vROi2VQ=</m:sig>
    </m:data>
  </recordData>
  <recordPosition>1</recordPosition>
</record>

or

<record>
  <recordSchema>http://example.org/stuff</recordSchema>
  <recordPacking>xml</recordPacking>
  <recordData>
    <m:photo xmlns:m='http://example.org/stuff'
xmlmime:contentType='image/png'>/aWKKapGGyQ=</m:photo>
  </recordData>
  <recordPosition>1</recordPosition>
</record>

Or even

<record>
  <recordSchema>http://example.org/stuff</recordSchema>
  <recordPacking>xml</recordPacking>
  <recordData>
    <m:photo
xmlns:m='http://example.org/stuff'>http://myserver.com/myphoto.png</m:ph
oto>
  </recordData>
  <recordPosition>1</recordPosition>
</record>


It would be fairly simple to apply XOP to the above if this was thought
necessary e.g. (modified from the example at
http://www.w3.org/TR/xop10/)

MIME-Version: 1.0
Content-Type: Multipart/Related;boundary=MIME_boundary;
    type="application/xop+xml";
    start="<mymessage.xml@example.org>";
    start-info="text/xml"
Content-Description: An SRU GET response with XOP and binary data

--MIME_boundary
Content-Type: application/xop+xml; 
    charset=UTF-8; 
    type="text/xml"
Content-Transfer-Encoding: 8bit
Content-ID: <mymessage.xml@example.org>

<record>
  <recordSchema> http://example.org/stuff</recordSchema>
  <recordPacking>xml</recordPacking>
  <recordData>
    <m:data xmlns:m='http://example.org/stuff'>
      <m:photo><xop:Include 
      xmlns:xop='http://www.w3.org/2004/08/xop/include' 
      href='cid:http://example.org/me.png'/></m:photo>
      <m:sig><xop:Include 
      xmlns:xop='http://www.w3.org/2004/08/xop/include' 
      href='cid:http://example.org/my.hsh'/></m:sig>
    </m:data>
  </recordData>
  <recordPosition>1</recordPosition>
</record>

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


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]