Loading ...
Sorry, an error occurred while loading the content.

Re: [soapbuilders] Will SOAP envelope always have a xml declaration?

Expand Messages
  • Simon Fell
    ... Nope, there s no requirement that a SOAP envelope must have an xml declaration. In the case of SOAP 1.1 s HTTP transport, the encoding is controlled via
    Message 1 of 4 , Jun 23, 2003
    • 0 Attachment
      On Mon, 23 Jun 2003 18:59:44 -0700, in ws you wrote:

      >Hi,
      >
      >I have a basic generic question. Can it be expected that all SOAP envelopes
      >will be preceded by a xml declaration? If yes, where is it mandated? If no,
      >how would the encoding be known at the wire?
      >
      ><?xml version="1.0" encoding="UTF-8" ?>
      ><SOAP-ENV:Envelope xmlns:SOAP-ENC="http:/ ------------------
      >--------------------------------
      >--------------------------------
      ></SOAP-ENV:Envelope>
      >

      Nope, there's no requirement that a SOAP envelope must have an xml
      declaration. In the case of SOAP 1.1's HTTP transport, the encoding is
      controlled via the charset attribute on the content-type header (and
      to be fully compliant with the spec, this should override any encoding
      indicated in the xml decl). In other cases, normal XML defaulting
      rules for the encoding apply. (the mechanics of which are detailed in
      the xml 1.0 spec)

      Cheers
      Simon
      www.pocketsoap.com
    • Rich Salz
      ... I think this is mostly right. The key point is that since a SOAP message is an XML document, you can omit the XML declaration and the usual defaults
      Message 2 of 4 , Jun 23, 2003
      • 0 Attachment
        > Nope, there's no requirement that a SOAP envelope must have an xml
        > declaration. In the case of SOAP 1.1's HTTP transport, the encoding is
        > controlled via the charset attribute on the content-type header (and
        > to be fully compliant with the spec, this should override any encoding
        > indicated in the xml decl). In other cases, normal XML defaulting
        > rules for the encoding apply. (the mechanics of which are detailed in
        > the xml 1.0 spec)

        I think this is mostly right. The key point is that since a SOAP message
        is an XML document, you can omit the XML declaration and the usual
        defaults apply.

        If transmitting SOAP over HTTP, however, the Content-Type, in particular
        the charset value, must agree with the SOAP (XML) message. The two are
        not supposed to be in conflict. This means that you will almost always
        omit the XML decl, and default to XML 1.0 utf-8, but then need a C-T
        header that gets the charset right.
        /r$
      • noah_mendelsohn@us.ibm.com
        In SOAP 1.2, the answer is that each protocol binding is responsible for specifying how the xml will look on the wire , and that includes whether to use an
        Message 3 of 4 , Jun 24, 2003
        • 0 Attachment
          In SOAP 1.2, the answer is that each protocol binding is responsible for
          specifying how the xml will look "on the wire", and that includes whether
          to use an xml 1.x serialization and if whether the xml declaration is
          allowed, required, or forbidden, and if present how the Encoding
          Declaration is interpreted (presumably in a manner compatible with the xml
          1.x recommendation.)

          The SOAP 1.2 Candidate Recommendation has an HTTP binding that requires
          support for Media Type application/soap+xml [1, 2]. That in turn
          specifies that the format must be the same as for application/xml, which
          is RFC 3023 [3]. My reading is that this allows but does not require the
          XML declaration, but it further makes clear that if a charset parameters
          is provided in a Content-type header, the charset parameter wins over
          whatever might be specified in the XML declaration. So, that's my reading
          of the behavior for the HTTP binding in SOAP 1.2.

          [1] http://www.w3.org/TR/2003/PR-soap12-part2-20030507/#httpmediatype
          [2] http://www.w3.org/TR/2003/PR-soap12-part2-20030507/#ietf-draft
          [3] http://www.ietf.org/rfc/rfc3023.txt

          ------------------------------------------------------------------
          Noah Mendelsohn Voice: 1-617-693-4036
          IBM Corporation Fax: 1-617-693-8676
          One Rogers Street
          Cambridge, MA 02142
          ------------------------------------------------------------------







          Rich Salz <r.salz@...>
          06/24/2003 01:15 AM
          Please respond to soapbuilders


          To: Simon Fell <ws@...>
          cc: "soapbuilders@yahoogroups.com" <soapbuilders@yahoogroups.com>, (bcc: Noah
          Mendelsohn/Cambridge/IBM)
          Subject: Re: [soapbuilders] Will SOAP envelope always have a xml declaration?


          > Nope, there's no requirement that a SOAP envelope must have an xml
          > declaration. In the case of SOAP 1.1's HTTP transport, the encoding is
          > controlled via the charset attribute on the content-type header (and
          > to be fully compliant with the spec, this should override any encoding
          > indicated in the xml decl). In other cases, normal XML defaulting
          > rules for the encoding apply. (the mechanics of which are detailed in
          > the xml 1.0 spec)

          I think this is mostly right. The key point is that since a SOAP message
          is an XML document, you can omit the XML declaration and the usual
          defaults apply.

          If transmitting SOAP over HTTP, however, the Content-Type, in particular
          the charset value, must agree with the SOAP (XML) message. The two are
          not supposed to be in conflict. This means that you will almost always
          omit the XML decl, and default to XML 1.0 utf-8, but then need a C-T
          header that gets the charset right.
          /r$



          -----------------------------------------------------------------
          This group is a forum for builders of SOAP implementations to discuss
          implementation and interoperability issues. Please stay on-topic.

          To unsubscribe from this group, send an email to:
          soapbuilders-unsubscribe@yahoogroups.com



          Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
        Your message has been successfully submitted and would be delivered to recipients shortly.