RE: New subset in latest SOAP draft

Noah

The SOAP PR spec [1] states a SOAP message must not contain: document type
declarations, processing instructions or comments before the main document
element.

A question. What should you do if the XML that you want to transport in the
SOAP Body contains this type of information and you want this information to
reach the ultimate destination so that it can be used?

Was this discussed by the group?

Regards

David


[1] http://www.w3.org/TR/soap12-part1/#soapenv

-----Original Message-----
From: noah_mendelsohn@us.ibm.com [mailto:noah_mendelsohn@us.ibm.com]
Sent: Friday, May 09, 2003 11:13 AM
To: Elliotte Rusty Harold
Cc: xml-dev@lists.xml.org; xml-dist-app@w3.org
Subject: Re: New subset in latest SOAP draft



(I've left off xmlp-comments on the distribution, as it's generally not 
for discussion)

Elliotte Rusty Harold writes:

> The recently posted proposed recommendation of SOAP
> Version 1.2 Messaging Framework
> <http://www.w3.org/TR/soap12-part1/#soapinterminfoset>
> further restricts the legal content of SOAP messages
> that what is generally known:
> 
> Comment information items MAY appear as children and/or
> descendants of the [document element] element
> information item but not before or after that element
> information item.
> 
> In other words, SOAP messages cannot contain comments
> in either the prolog or epilog of a document. This was
> inferrable from the previous December 2002 working
> draft, but was stated in much less obvious language.

(speaking for myself and not officially for the WG)

By definition, SOAP messages come into existence as Infosets (typically 
synthetic infosets [1]) at the original sender, and must be formulated 
according to the rules of the SOAP recommendation.  As you observe, the PR 
draft makes it allegal to include comments except as descendents of the 
[document element].   An Infoset that has a comment elsewhere is by 
definition not a SOAP envelope.  Also, the Infoset Recommendation does not 
define concepts of prolog and epilog (though it refers in passing to the 
XML 1.0 prolog and epilog constructs)  It's thus probably a little more 
precise to  rephrase the first sentence of your paragraph above as:  "if 
serialialized as XML 1.x documents, SOAP envelopes will not contain 
comments in either the prolog or the epilogue", and this is true.

> If I had to guess, I'd say this is an attempt to allow
> multiple SOAP messages to be stuffed into a single file
> or stream with clear boundaries between them. 

Speaking only for my personal understanding of the group's motives, I 
don't think so.  I suppose you could build MEPs and/or bindings to do such 
"stuffing", but I don't think we discussed that at all, or that it had 
anything to do with the comment decision.

I think the feeling was:  lots of people will build lots of software to 
create, store, relay, and manipulate SOAP messages.  Some of those 
implementations will use XML 1.0 serializations (as the HTTP binding 
does), but others will use in-memory data structures, alternate 
serializations, special-purpose XML databases etc.  Allowing comments 
outside the document element is just one more complication for such 
implementations, and it's not clear that it adds much value.  We expect 
comments to be used primarily for debugging and readability information 
(since the vast majority of SOAP messages will be automatically 
generated), or in cases where existing XML fragments are "clipped into" a 
body or header (and our rules do allow comments there, and even call for 
them to be preserved when relayed, if I recall.)   I think we felt that 
any debugging or explanatory information applying to the whole message 
could as well be carried within the root element.  This gives us a nice 
invariant that the envelope itself is always the single information item, 
which is a very convenient abstraction for software such as durable 
message queueing systems that may wish to use XML databases as an 
implementation technology

I think that's a fair summary of at least the sorts of things we 
considered.  As I've said several times, my view is that SOAP is an 
application of XML, not a redefinition of it.  Nothing in the XML spec 
says that generators of XML documents or particular applications of XML 
must use all the features of the language.  Parsers claiming conformance 
must support all features, but that's not the issue here.  All SOAP 
content is generated per the SOAP spec.  If serialized in the obvious 
manner to XML 1.0, it can invariably be parsed by any conforming XML 1.0 
processor.

> Whether
> that's a good idea or not, I don't think such a major
> change should be tossed out without further analysis
> and debate. This could introduce problems for various
> tools such as editors that like to stick a "credit"
> comment in the prolog of a document. This spec should
> go back to last call WD.

It's not clear to me that the design point is for SOAP messages to be 
generated by arbitrary applications (e.g. interactive editors) that stick 
arbitary content into the messages.  (I don't mean "arbitrary" to be taken 
as pejorative.)  If you use XML tools, then you must use tools that give 
you enough control to generate the desired content.  For some purposes, 
extra comments are OK.  For some purposes changing single to double quotes 
on attribute values is OK, etc., etc., yet there are situations in which 
none of these liberties is acceptable. 

So, I don't think you can say "SOAP is broken because I want to use 
editors that insert arbitrary comments to create it."  There's nothing in 
the XML Recommendation that says every application of XML must allow 
comments (or PIs or whatever) at arbitrary points in the document, or that 
the application must be unaffected by such comments (for example, one of 
the DSIg canonicalizations considers comments significant to the 
signature.) 

Thus, I personally disagree that what we've done is a mistake, or that it 
should take us back to WD, but I certainly think it's appropriate that you 
raise the issue given your feelings.  I'm sure that we and the others 
involved in making a decision in moving beyond PR will consider the issue 
seriously.  Thank you.

[1] http://www.w3.org/TR/xml-infoset/#intro.synthetic

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







Elliotte Rusty Harold <elharo@metalab.unc.edu>
Sent by: xml-dist-app-request@w3.org
05/08/03 07:45 AM

 
        To:     xml-dev@lists.xml.org
        cc:     xml-dist-app@w3.org, xmlp-comments@w3.org, (bcc: Noah 
Mendelsohn/Cambridge/IBM)
        Subject:        New subset in latest SOAP draft



The recently posted proposed recommendation of SOAP Version 1.2 
Messaging Framework 
<http://www.w3.org/TR/soap12-part1/#soapinterminfoset> further 
restricts the legal content of SOAP messages that what is generally 
known:

Comment information items MAY appear as children and/or descendants 
of the [document element] element information item but not before or 
after that element information item.

In other words, SOAP messages cannot contain comments in either the 
prolog or epilog of a document. This was inferrable from the previous 
December 2002 working draft, but was stated in much less obvious 
language.

If I had to guess, I'd say this is an attempt to allow multiple SOAP 
messages to be stuffed into a single file or stream with clear 
boundaries between them. Whether that's a good idea or not, I don't 
think such a major change should be tossed out without further 
analysis and debate. This could introduce problems for various tools 
such as editors that like to stick a "credit" comment in the prolog 
of a document. This spec should go back to last call WD.


-- 

   Elliotte Rusty Harold
   elharo@metalab.unc.edu
   Processing XML with Java (Addison-Wesley, 2002)
   http://www.cafeconleche.org/books/xmljava
   http://www.amazon.com/exec/obidos/ISBN%3D0201771861/cafeaulaitA

Received on Friday, 9 May 2003 18:39:21 UTC