Chris's Rants

Saturday, November 13, 2004

WS-Transfer != BP1.x conformant

Oops! Apparently, the WS-Transfer "Get" operation is not WS-I Basic Profile 1.x conformant.

The WSDL definition for the GET operation is defined as follows:
<wsdl:definitions ...>

...
<wsdl:message name="Empty"/>
<wsdl:message name="AnyXml">
<wsdl:part name="data" type="tns:AnyXmlType"/>
</wsdl:message>
...
<wsdl:portType name="Resource">
...
<wsdl:operation name="Get">
<wsdl:input message="tns:Empty"/>
<wsdl:output message="tns:AnyXml"/>
</wsdl:operation>
...
</wsdl:portType>
...
</wsdl:definitions>
Note that the message part "data" uses the 'type' attribute and binds the tns:AnyXmlType, which is a complexType in the WS-Transfer schema.

The WS-I Basic Profile 1.1 contains the following requirements:
R2204 A document-literal binding in a DESCRIPTION MUST refer, in each of its soapbind:body element(s), only to wsdl:part element(s) that have been defined using the element attribute.

R2207 A wsdl:message in a DESCRIPTION MAY contain wsdl:parts that use the elements attribute provided those wsdl:parts are not referred to by a soapbind:body in an rpc-literal binding.

R2729 An ENVELOPE described with an rpc-literal binding that is a response MUST have a wrapper element whose name is the corresponding wsdl:operation name suffixed with the string "Response".
Thus, one must conclude that the only possible binding for the "Get" operation would be an rpc-literal binding, and the response message must have a wrapper element with a local name of "GetResponse". However, the example in the spec for the GetResponse message is as follows:
<s:Envelope ...>

<s:Header ...>
<wsa:Action>
http://schemas.xmlsoap.org/ws/2004/09/transfer/GetResponse
</wsa:Action>
<wsa:RelatesTo>xs:anyURI</wsa:RelatesTo>
<wsa:To>xs:anyURI</wsa:To>
...
</s:Header>
<s:Body ...>
xs:any
</s:Body>
</s:Envelope>
The response message should actually be:
<s:Envelope ...>

<s:Header ...>
<wsa:Action>
http://schemas.xmlsoap.org/ws/2004/09/transfer/GetResponse
</wsa:Action>
<wsa:RelatesTo>xs:anyURI</wsa:RelatesTo>
<wsa:To>xs:anyURI</wsa:To>
...
</s:Header>
<s:Body ...>
<wxf:GetResponse xmlns:wxf="http://schemas.xmlsoap.org/ws/2004/09/transfer">
xs:any
</wxf:GetResponse>

</s:Body>
</s:Envelope>
My guess is that this is not what the authors intended (since Microsoft doesn't support rpc-literal WSDL bindings). In fact, there is no way to describe in WSDL1.1 a doc-literal operation that has an input or output message with unspecified content.

I actually think that a more appropriate approach to handling WS-Transfer's "Get" would be to specify the output message as you would any doc-literal operation and merely annotate the operation with the appropriate wsa:Action attribute values. Thus, the consumer of the WSDL could determine what to expect in response to a "Get" while at the same time, implementations of the "Get" operation could use it to retrieve arbitrary content as was intended.

e.g.
<wsdl:definitions ...>

...
<wsdl:message name="Empty"/>
<wsdl:message name="MyMessage">
<wsdl:part name="data" element="tns:MyElement"/>
</wsdl:message>
...
<wsdl:portType name="MyPortType">
...
<wsdl:operation name="Get">
<wsdl:input message="tns:Empty"
wsa:Action="http://schemas.xmlsoap.org/ws/2004/09/transfer/Get"/>
<wsdl:output message="tns:MyMessage"
wsa:Action="http://schemas.xmlsoap.org/ws/2004/09/transfer/GetResponse"/>

</wsdl:operation>
...
</wsdl:portType>
...
</wsdl:definitions>

1 Comments:

Post a Comment

<< Home