axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James M Snell" <jasn...@us.ibm.com>
Subject Re: doc/lit discussion addition
Date Tue, 16 Jul 2002 21:55:51 GMT
Russell said: "I think we have to say that if it's encoded (rpc/enc) then 
it MUST be types.  If it's literal (doc/lit) then it can be types or 
elements and, only if there is a single element, it may be wrapped. 
Discussion?  Is my last paragraph acceptible?"

The WSDL message type definition doesn't say anything about whether or not 
the SOAP binding is doc/lit or rpc/enc.  The message definition is an 
abstract definition of the message type, not a description of the message 
realization. 

Take the following case for instance:

<complexType name="MyPartType">
   <sequence>
      <element name="Test" type="xsd:string" />
   </sequence>
</complexType>
<element name="MyPart" type="MyPartType" />

<message name="Test">
  <part name="Part" type="xsd:anyType" />
</message>

<portType name="PortType">
   <operation name="Operation">
      <input message="Test" />
   </operation>
</portType>

<binding name="Binding" type="PortType">
   <soap:binding style="document" ... />
   <operation name="Operation">
      <soap:operation ... />
       <input>
          <soap:body use="literal" ... />
       </input>
   </operation>
</binding>

<s:Envelope>
    <s:Body>
      <MyPart>
         <Test>Testing123</Test>
      </MyPart>
    </s:Body>
</s:Envelope>

This is a perfectly valid use case of doc/lit.

Alternatively, the following example is an equally valid instance of 
rpc/enc if the SOAP engine properly encodes the native application type as 
the specified element value.

<message name="Test">
  <part name="Part" element="MyPart" />
</message>

<portType name="PortType">
   <operation name="Operation">
      <input message="Test" />
   </operation>
</portType>

<binding name="Binding" type="PortType">
   <soap:binding style="rpc" ... />
   <operation name="Operation">
      <soap:operation ... />
       <input>
          <soap:body use="encoded" ... />
       </input>
   </operation>
</binding>

<s:Envelope>
    <s:Body>
      <MyPart>
         <Test xsi:type="xsd:string">Testing123</Test>
      </MyPart>
    </s:Body>
</s:Envelope>

In both of these cases, only the binding provides the information about 
whether or not doc/lit or rpc/enc is to be used.  Axis should not invent 
any additional (and artificial) rules on the use of WSDL's message type to 
solve this problem. 

(In fact, the distinction between enc and lit is fairly artificial and 
unnecessary in the WSDL description as the choice of whether or not to use 
enc or lit should really be an implementation decision made by the service 
provider or requester.  The WSDL SHOULD ONLY describe what the XML has to 
look like on the wire, leaving it up to the developer and his/her SOAP 
runtime to figure out how to produce that XML.  But, that's another 
argument altogether that doesn't belong in this forum)

- James M Snell/Fresno/IBM
    Web services architecture and strategy
    Internet Emerging Technologies, IBM
    544.9035 TIE line
    559.587.1233 Office
    919.486.0077 Voice Mail
    jasnell@us.ibm.com
 Programming Web Services With SOAP, O'reilly & Associates, ISBN 
0596000952 

==
Have I not commanded you?  Be strong and courageous.  Do not be terrified, 

do not be discouraged, for the Lord your God will be with you wherever you 
go.  
- Joshua 1:9

Please respond to axis-dev@xml.apache.org 
To:     axis-dev@xml.apache.org
cc: 
Subject:        doc/lit discussion addition



Remember our doc/lit dicussion on the chat today?  We decided that 

<message>
<part name="x" type="something"/>
</message>

means rpc/enc and

<message>
<part name="x" element="something"/>
</message>

means doc/lit.  Am I right so far?  (I'm ignoring doc/enc and rpc/lit.) 
Did we say also that messages with types COULD NOT be doc/lit and messages 
with elements COULD NOT be rpc/enc?  I don't recall.  If we did, we can't.

Take a look at WSDL section 5.1.  How are we supposed to deal with

<message>
<part name="body" element="tns:GetCompanyInfoResult"/>
<part name="docs" type="xsd:string"/>
<part name="logo" type="tns:ArrayOfBinary"/>
</message>

This is the MIME attachment example.  In the binding you discover that 
"body" is a doc/lit, "docs is of MIME type "text/html", and "logo" is of 
MIME type "image/gif" or "image/jpeg".

I think we have to say that if it's encoded (rpc/enc) then it MUST be 
types.  If it's literal (doc/lit) then it can be types or elements and, 
only if there is a single element, it may be wrapped.

Discussion?  Is my last paragraph acceptible?

Russell Butek
butek@us.ibm.com



Mime
View raw message