Re: Clarification on use of encodingStyle attribute

Henrik,

encodingStyle in SOAP 1.1 is described as "... This attribute MAY
appear on any element, and is scoped to that element's contents and
all child elements not themselves containing such an attribute, much
as an XML namespace declaration is scoped. ...." This makes a lot of
sense to me, it works like many things in XML, namespaces, xml:base,
etc.

The current SOAP 1.2 definition seems to be similar (IMHO, it suffers
in readability due the infoset wording), but explicitly disallows its
use on the Envelope (but not Header).

Given that a large % of messages use a single encodingStyle, from an
efficiency point of view, its useful to be able to set it once, and
have it apply to the whole message, obviously if parts are serialized
with a differing encoding style, those parts can change the
encodingStyle as needed.

I can see your point WRT to headers, but wouldn't this also apply to
body though ?, it can have 0..n children.

At the end of the day, it could go either way, as long as the prose
and schema match, I'll be happy.

Cheers
Simon
www.pocketsoap.com
[1]
http://www.w3.org/2000/xp/Group/1/10/11/soap12-part1.html#soapencattr

On Tue, 19 Mar 2002 11:17:40 -0800, in soap you wrote:

>
>Simon,
>
>In [2] you point out some discrepancy between the schema and the spec
>text as to where the SOAP encodingStyle attribute can appear in a SOAP
>message.
>
>IMO, the purpose of the encodingStyle attribute is to enable to indicate
>a *change* in any encoding used. If there is *no* encodingStyle
>attribute then we say nothing, if there is, then it indicates a change
>to that encoding. If there are multiple encodingStyle attributes then
>they each represent a change of encodingStyle.
>
>In order for this to work, it is important for the encodingStyle
>attribute to be nestable - that is, one has to be able to change
>encoding at any point. For example, if I have a struct with some data
>that follows my own encoding in the middle of something that uses the
>SOAP encoding, I would want to be able to say:
>
><env:Body encodingStyle="http://www.w3.org/2001/12/soap-encoding">
>  <m:TradePrice xmlns:m="http://example.org/2001/06/quotes">
>    <PriceAndVolume>
>      <LastTradePrice>34.5</LastTradePrice>
>      <DayVolume>10000</DayVolume>
>    </PriceAndVolume>
>    <p:Blob xmlns:p="http://example.org/blobs" env:encodingStyle="">
>      <...> no encoding here </...>
>    </p:Blob>
>  </m:GetLastTradePriceResponse>
></env:Body>
>
>This means that <TradePrice> is a struct, <Blob> is an outbound edge but
>the *value* of the terminating node is *not* represented using SOAP
>encoding but in this case by no encoding as indicated by the
>encodingStyle attribute. In other words, the encodingStyle attribute
>indicates a change with respect to the contents (value) of the node, not
>the edge.
>
>As a result, it makes sense to allow encodingStyle on Body - it doesn't
>apply to the Body element information item but to its contents. On the
>other hand, it doesn't make sense to put the attribute on the Envelope
>and Header element information items as Header blocks don't follow any
>particular encoding style and neither does Envelope contents.
>
>Btw, I don't think some of our examples in [3] are quite right with
>respect to the use of the encodingStyle attribute.
>
>Makes sense?
>
>Henrik Frystyk Nielsen
>mailto:henrikn@microsoft.com
>
>[1]
>http://lists.w3.org/Archives/Member/w3c-xml-protocol-wg/2002Feb/0161.htm
>l
>[2] http://lists.w3.org/Archives/Public/xml-dist-app/2002Jan/0274.html
>[3]
>http://www.w3.org/2000/xp/Group/1/10/11/soap12-part2.html#httpexamples

Received on Wednesday, 20 March 2002 11:47:01 UTC