LC323: mention of HTTP Accept headers in the HTTP binding

LC323[1] points out that we mention HTTP Accept headers in the HTTP
binding, but that we do not say how they come into play. This is
particularly interesting as {http output serialization} only allows
one value. Yet, expectedMediaType is mentioned.

Thinking about this more, I figured out what we had in mind with HTTP
Accept headers and mentioning expectedMediaType.

If one defines an output message as:

  <xs:element name="pic">
    <xs:complexType>
      <xs:sequence>
 <xs:element name="desc" type="xs:string"/>
 <xs:element name="content" type="tns:PictureType" 
      xmime:expectedContentTypes="image/jpeg, image/png"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>

And if this output message is serialized as application/xml, then if I
do an HTTP request with the following Accept headers "application/xml,
image/png", I am likely to be given back:

  <pic>
    <desc>Cool pic!</desc>
    <content xmime:contentType="image/png">…</content>
  </pic>

So, I don't believe that there is a technical issue with the spec. On
the other hand, this text is obviously confusing. I have thought of
providing a better wording, but in the end, I am wondering if this
really belongs to the HTTP Binding, as this is more related to the
Assigning Media Types to Binary Data in XML document.

I am therefore proposing to move this text to the primer, as follows.
In section 4.5 MTOM and Attachments Support, after "Note the use of
the xmime:expectedContentType and xmime:contentType … Data in XML]." —
though there may actually be a better place for this text —, add:

    Also note that, when using the WSDL HTTP Binding, an
    implementation MAY use incoming HTTP Accept headers to choose
    between alternative media types listed in
    xmime:expectedContentType.

Regards,

Hugo

  1. http://www.w3.org/2002/ws/desc/5/lc-issues/#LC323
-- 
Hugo Haas - W3C
mailto:hugo@w3.org - http://www.w3.org/People/Hugo/

Received on Friday, 23 September 2005 12:31:05 UTC