Share via


服務作業

服務作業是與服務特定作業相關聯的程式碼和中繼資料。

就 WSDL 而言,在指定 portType 的 WSDL 檔案中定義的每個 wsdl:operation 都是服務作業。

<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" 
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://Example.org" 
xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" 
xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" 
xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:wsa10="http://www.w3.org/2005/08/addressing" 
xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex" targetNamespace="http://Example.org" 
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
 <wsdl:portType name="ICalculator">
  <wsdl:operation name="Add">
   <wsdl:input wsaw:Action="http://Example.org/ICalculator/Add" 
   message="tns:ICalculator_Add_InputMessage" />
   <wsdl:output wsaw:Action="http://Example.org/ICalculator/AddResponse" 
   message="tns:ICalculator_Add_OutputMessage" />
  </wsdl:operation>
 </wsdl:portType>
</wsdl:definitions>

服務模型中的每個服務作業都會指定為 WS_OPERATION_DESCRIPTION。 WS_OPERATION_DESCRIPTION是由 wsutil.exe產生。

針對每個 wsdl:operation,此工具會產生個別 的WS_OPERATION_DESCRIPTION

顯示wsutil.exe如何產生WS_CONTRACT_DESCRIPTION的圖表。

static WS_OPERATION_DESCRIPTION serviceOperationsICalculator[] =
{
    {
        // Add Method
        &messageDescriptionAddICalculator,
        &messageDescriptionAddResponseICalculator,
        WsCountOf(parametersAddICalculator),
        ICalculator_Add_Stub 
    }
};

就程式碼而言,每個服務作業都有與其相關聯的函式。 此函式的定義與用戶端和伺服器不同。

服務作業會分類為、

此分類主要以伺服器簽章配置和服務作業的用戶端實作為基礎。

另請參閱 WSDL 支援一節

下列列舉會與服務作業搭配使用:

下列結構會與服務作業搭配使用: