Marking operations safe

As per the action item I took over from Philippe,

  2004-01-30: Philippe to draft a note for the group around safe
  operations.

please find below a proposal presenting options to indicate
operation's properties.

-=- Background -=-

I found the following discussions in the mailing list:

  New issue: Representing safe operations
  http://lists.w3.org/Archives/Public/www-ws-desc/2002May/0159.html

  Marking WSDL operations as "safe", in scope requirement?
  http://lists.w3.org/Archives/Public/www-ws-desc/2003Nov/0104.html

  30 Jan 2004 WS Description FTF: Flagging an operation as 'safe'
  http://lists.w3.org/Archives/Public/www-ws-desc/2004Feb/0011.html

Additionally, there were the following discussions in the Web Services
Architecture Working Group:

  WSD Requirements: add a requirement about safe and idempotent characteristics
  http://lists.w3.org/Archives/Public/www-ws-arch/2002Nov/0157.html

-=- Discussion -=-

Operations can have side-effects (updating a data in a database,
ordering a DVD, etc.). When they do not, those operations are called
safe. Safeness may not be the only characteristics of an operation
that one may want to advertize. One may also want to indicate whether
the operation is idempotent. Those concepts are defined in the Web
Services Glossary[1].

The motivations for flagging a Web services interaction as safe or
idempotent include the following:

- a safe operation is cachable; it may be serializable as an HTTP GET
  (or even HEAD) request; if so, the request can take advantage of the
  Web infrastructure such as caches.

- a toolkit could make the choice of using an HTTP GET or SOAP GET
  binding for such operations (e.g. GetStockQuote) if there where
  marked as such.

- knowing that an operation is safe or idempotent can allow poor-man's
  message reliability, or message reliability optimizations: safe and
  idempotent operations can be repeated without additional
  side-effects, and therefore this eliminates the problem of ensuring
  that a message is received only once.

- it would help developers to align their deployed Web services with
  the "URIs, Addressability, and the use of HTTP GET and POST" TAG
  finding[3].

The safeness and idempotency of a Web service request are independent
from the binding used, so it makes sense to express them at the
operation level. Since an operation could involve any MEP, we need to
specify that we are talking here about state from the service's point
of view.

Based on this, below are two proposals to express safeness at in WSDL
2.0:

-=- 1. Introducing a side-effect property to Interface Operation -=-

This would be expressed using an attribute information item, and could
take different values:

	Safe operation
	http://www.w3.org/2004/02/wsdl/se/safe

	Idempotent operation
	http://www.w3.org/2004/02/wsdl/se/idempotent

Example:

     <operation name="GetStockQuote" pattern="http://www.w3.org/2003/11/wsdl/in-out"
                se="http://www.w3.org/2004/02/wsdl/se/safe">
       <input message="tns:gsqReq"/>
       <output message="tns:gsqResp"/>
     </operation>


-=- 2. Introducing a side-effect features -=-

We could define a side-effect WSDL feature:

	http://www.w3.org/2004/02/wsdl/se

This feature would only be applied to an interface operation, as it
doesn't make sense to apply it at the binding level. This feature
would have one property:

	http://www.w3.org/2004/02/wsdl/se-type

The possible values are the same as above:

	Safe operation
	http://www.w3.org/2004/02/wsdl/se/safe

	Idempotent operation
	http://www.w3.org/2004/02/wsdl/se/idempotent

Example:

     <operation name="GetStockQuote" pattern="http://www.w3.org/2003/11/wsdl/in-out">
       <feature uri='http://www.w3.org/2004/02/wsdl/se'
                required='false'>
       </feature>
       <property name='http://www.w3.org/2004/02/wsdl/se-type'>
         <value>http://www.w3.org/2004/02/wsdl/se/safe</value>
       </property>
       <input message="tns:gsqReq"/>
       <output message="tns:gsqResp"/>
     </operation>

Regards,

Hugo

  1. http://www.w3.org/TR/2003/WD-ws-gloss-20030808/
  3. http://www.w3.org/2001/tag/doc/whenToUseGet.html
-- 
Hugo Haas - W3C
mailto:hugo@w3.org - http://www.w3.org/People/Hugo/

Received on Friday, 27 February 2004 08:56:02 UTC