Issue 169: Propose http method in the operation interface to simplify http binding.

Issue 169 is a follow on to issue 54, which is to support binding to any HTTP Method.  We resolved to support binding to HTTP methods in the binding, but I believe this misses the 80/20 mark for HTTP bindings and misses significant chances for simple modelling of HTTP interactions.  As part of issue 54 resolution, I proposed a mechanism to support HTTP methods at the interface level in order to enable re-use of this information at the binding level and to more correctly model the application interface.  I propose that WSDL 2.0 supports WebMethod by allowing web methods on interface operations, optionally using this in bindings, and re-using the HTTP method attribute.

The advantages to this approach are two-fold:
- Applications that use a generic interface "know" this at the interface design level.  This use of a generic interface, even if the specific operations are "named" uniquely, is valuable design time information.  As such, it does not belong only in the binding elements.
- Providing this information at the abstract interface allows for a simpler binding in common cases, such as binding GET/PUT/POST/DELETE operations to a single protocol and URI.

The changes to WSDL are:
1. WSDL interface operations contain optional webMethod attribute.   This is an HTTP operation name.  
2. WSDL bindings use any existing interface operation webMethod attribute as the default.
3. WSDL binding contains an optional location that is the default for any operations in the binding.  To use the x-www-form-urlencoded, the schema used in the location should be available in all operations inputs that are defaulted in the binding.
Sample third party definitions


     <!-- Uses the webMethod attribute -->
     <wsdl:interface name="StockQuotes">
         <wsdl:operation name="getStockQuote" wsdl:webMethod="GET">
             <wsdl:input element="schema1"/>
             <wsdl:output element="schema2"/>
         <wsdl:operation name="getStockQuoteGoldPayingCustomer" wsdl:webMethod="GET">
             <wsdl:input element="schema1"/>
             <wsdl:output element="schema2"/>
         <wsdl:operation name="putStockQuote" wsdl:webMethod="PUT">
             <wsdl:input element="schema1"/>
             <wsdl:output element="schema2"/>

    <!-- The binding that uses a single URI and the webMethod is quite simple -->
    <wsdl:binding name="myns:HTTPOneURIAndUseWebMethod" interface="myns:StockQuotes" http:location="./{schema1-element}" />
	<!-- the binding provides a location for all the operations

    <wsdl:binding name="myns:HTTPOneURIPerOperationAndUseOperationWebMethod">
        <operation name="myns:getStockQuote" http:location="..."/>
        <operation name="myns:getStockQuoteGoldPayingCustomer" http:location="...(different loc)"/>
        <operation name="myns:putStockQuote" http:location="...(yet another different loc)" />

   <wsdl:binding name="myns:HTTPOneURI">
      <!-- Changing the abstract method into the protocol method.  Atom has a binding that sends PUT and DELETE requests over POST -->
        <operation name="myns:getStockQuote" http:method="GET" />
        <operation name="myns:getStockQuoteGoldPayingCustomer" http:method="GET" />
        <operation name="myns:putStockQuote" http:method="POST" />




Received on Tuesday, 29 June 2004 15:40:49 UTC