RE: Handling the XML Prolog inside SOAP

Noah

Thanks for the feedback. I realise and accept that this is really a problem
of XML rather than SOAP. That said, the use case I had in mind was one where
XML was being generated and transported internally using some non-SOAP
protocol (e.g. a MOM transport) which eventually gets to an outbound server
where the XML needs to be packaged up and sent using SOAP.

I think this means that architecturally there needs to be a separation of
the layers between the layer that is generating the content (the XML
document) and the layer that is transporting the content (e.g. SOAP + HTTP).
From what you say below, the only way to realize this separation seems to be
to use SwA (or some variant) or Base64 encoding.

On the other hand, you could equally imagine a different implementation of
the same message where the XML Content and SOAP were generated at the same
time and therefore there would be no need to use SwA/Base64 encoding since
all the potential conflicts you mention below could be resolved at message
generation time.

Now given that I think need to do this type of separation will be common -
think legacy ERP system with a SOAP front end, wouldn't this mean that if
you were designing a message that could be handled with both types of
implementation, then you would have to always use SwA/base64  as the way of
packaging the XML document if you did not want to impose architectural
constraints on an implementation?

Alternatively, could you make it possible to transport any arbitrary XML
document in the SOAP body by:
1. Stripping the prolog from the XML document and placing the rest of the
document inside the SOAP body.
2. Creating a SOAP Header/Feature, to carry the prolog information inside a
CDATA section as in, for example: <Prolog><![CDATA[<?xml
version="1.0"?>]]></Prolog>
3. On receipt, recreate the original XML document by concatenating the
content of the prolog element with the content of the SOAP Body?

Then, if you needed to recreate the complete XML document you could if you
wanted to.

Regards

David


-----Original Message-----
From: noah_mendelsohn@us.ibm.com [mailto:noah_mendelsohn@us.ibm.com]
Sent: Tuesday, May 13, 2003 7:55 PM
To: Burdett, David
Cc: XML Dist-App (E-mail)
Subject: Re: Handling the XML Prolog inside SOAP


Short answer:  no, you're not missing anything.  A fundamental decision in 
SOAP was to model messages primarily as XML.  This gives us lots of 
synergy with XML tools, schema languages, etc., but it means we also pick 
up the limitations of XML.  In general, it is not possible 
(unfortunately!) to nest multiple XML documents in a single outer 
document. That's an XML limitation, not particular to SOAP.   Any DTD 
would have to be at the outside, and all its declarations (for IDs, 
entities, and the like) would apply to the entire document.  IDs could 
conflict or IDREFS could be unintentionally resolved, etc.   Depending on 
how you do it, there can be issues with default namespaces, etc.  I think 
this is probably one of the major design flaws in XML, but there it is. 
Nested XML documents can be carried in SOAP as attachments using the 
attachment technology of your choice, or as base64binary or hexBinary 
encodings. 

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







"Burdett, David" <david.burdett@commerceone.com>
Sent by: xml-dist-app-request@w3.org
05/13/2003 12:49 PM

 
        To:     "XML Dist-App (E-mail)" <xml-dist-app@w3.org>
        cc:     (bcc: Noah Mendelsohn/Cambridge/IBM)
        Subject:        Handling the XML Prolog inside SOAP


I'm reposting this question as I did not get any response earlier.
 
The SOAP PR spec [1] states a SOAP message must not contain information 
that often goes in the XML Prolog such as: 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 was 
originally a complete XML document (perhaps digitally signed) that 
contains this type of information and you want this information to be 
preserved when the document reaces the ultimate destination so that it can 
be used?
 
My reading of the current SOAP spec suggests that this is not possible 
unless you Base64 encode it ... or am I missing something.
 
David
PS I realise this may have been already discussed but I missed it.
 
[1] http://www.w3.org/TR/soap12-part1/#soapenv 

Received on Wednesday, 14 May 2003 17:13:52 UTC