RE: encodingStyle

Frank de Rose writes:

>> Noah, as your distinction between "the legal forms of a message"
>> and "the interpretation of those forms" suggests, haven't we left
>> the realm of encodingStyle and crossed over into
>> semantics.

Well, "yes" insofar as we are saying something about the significance of
the syntax, "no" in that when we specify an encoding we don't indicate
whether a particular soap element signals a request for stock quotes or an
order for pizza.

SOAP could have taken a different form in which element names would signal
encoding structures:

        <SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
                              xmlns:SOAP-ENC="
http://schemas.xmlsoap.org/soap/encoding/">
                <SOAP-ENV:Body>
                        <SOAPENC:STRUCT NAME="GetStockQuote">
                                <SOAPENC:StructField Name="Company">
                                        MSFT
                                </SOAPENC:StructField>
                </SOAP-ENV:Body>
        </SOAP-ENV:Envelope>

I think this would have been very ugly and inconvient, but in this case
the XML schema would have directly conveyed what we think of encoding:  it
would have told you which things were SOAP "structs", etc.  But, SOAP
doesn't work this way.  The stock quote is more likely  requested by:

        <SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
 xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/">
                <SOAP-ENV:Body
 SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">>
                        <GetStockQuote>
                                <Company>
                                        MSFT
                                </Company>
                        </GetStockQuote>
                </SOAP-ENV:Body>
        </SOAP-ENV:Envelope>

The encoding style thus tells a SOAP deserializer something that the
schema does not (and as Dave Winer points out, there are situations in
which you don't want to depend on a schema):  although it's not obvious
with this trivial call, the encoding style is telling you about the data
structure that is being transmitted.   Certainly for RPC, and sometimes in
other situations, this is very useful.

By the way, I am not thrilled with the way WSDL chooses to deal with the
schema/encoding distinction.  I would have preferred an approach, I think,
in which WSDL described an RPC interface at the level of structs, arrays,
etc., and with an associated encoding style, along with specific schemas
if and only if the specific serialization was to be bounded.  I don't
think WSDL is fatally flawed or should necessarily be changed at this
point, it's just not quite how I think I would have done it.  (By the way,
for straight non-RPC SOAP messaging, I think WSDL is fine.)

------------------------------------------------------------------------
Noah Mendelsohn                                    Voice: 1-617-693-4036
Lotus Development Corp.                            Fax: 1-617-693-8676
One Rogers Street
Cambridge, MA 02142
------------------------------------------------------------------------

Received on Wednesday, 4 April 2001 11:30:44 UTC