<webServices> 項目

控制使用 ASP.NET 部署的 Web 服務設定,以及在 .NET Framework 上執行之 Web 服務用戶端的設定。

<configuration>

  <system.web>

    <webServices> 項目

<webServices> 
      <protocols> 
            <add name="protocol name"/>
            <remove name="protocol name"/>
            <clear/>
      </protocols>
      <serviceDescriptionFormatExtensionTypes> 
            <add type="type"/>
            <remove type="type"/>
            <clear/>
      </serviceDescriptionFormatExtensionTypes>
      <soapExtensionTypes>
            <add type="type" priority="number" group="0|1"/>/>
            <remove type="type"/>
            <clear/>
      </soapExtensionTypes>
      <soapExtensionReflectorTypes>
            <add type="type" priority="number" group="0|1"/>/>
            <remove type="type"/>
            <clear/>
      </soapExtensionReflectorTypes>
      <soapExtensionImporterTypes>
            <add type="type" priority="number" group="0|1"/>/>
            <remove type="type"/>
            <clear/>
      </soapExtensionImporterTypes>
      <wsdlHelpGenerator href="help generator file"/>
      <diagnostics suppressReturningExceptions="true|false" />
</webServices>

屬性和項目

下列章節將說明屬性、子項目和父項目。

屬性

無。

子項目

子項目 描述

diagnostics

指定是否要將例外狀況傳回至用戶端做為偵錯用途。

protocols

指定通訊協定,讓 ASP.NET Web 服務可藉以接收從用戶端傳來的要求資料並傳回回應資料。一種通訊協定,可使要求資料和方法及其參數之間產生關聯,以及使回應資料和方法及其傳回值之間產生關聯。

serviceDescriptionFormatExtensionTypes

指定服務描述格式擴充功能,以便在組態檔範圍內執行。

soapExtensionTypes

指定 SOAP 擴充功能,以在 Web 服務或用戶端上處理時,檢查或修改 SOAP 訊息。SOAP 擴充功能可以擴充 Web 服務的功能。

soapExtensionReflectorTypes

指定 SOAP 擴充反映程式類別,以擴充服務描述 (WSDL 文件) 的產生處理序。搭配服務描述格式擴充功能 (SDFE) 使用。

soapExtensionImporterTypes

指定 SOAP 擴充匯入工具類別,此類別會擴充用戶端 Proxy 產生處理序。搭配服務描述格式擴充功能 (SDFE) 使用。

wsdlHelpGenerator

指定當瀏覽器直接瀏覽至 ASMX Web 服務網頁時,瀏覽器顯示的 Web 服務說明網頁 (.aspx 檔案)。

父項目

項目 描述

configuration

Common Language Runtime 和 .NET Framework 應用程式所使用之每個組態檔中的根項目。

system.web

指定 ASP.NET 組態區段的根項目。

範例

下列範例指定 XML Web Service 組態設定。

<configuration>
   <system.web>
      <webServices>
         <diagnostics suppressReturningExceptions="false"/>
         <protocols>
            <add name="HttpGet"/>
            <add name="HttpPost"/>
            <add name="Documentation"/>
         </protocols>
         <serviceDescriptionFormatExtensionTypes>
         </serviceDescriptionFormatExtensionTypes>
         <soapExtensionTypes>
         </soapExtensionTypes>
         <soapExtensionReflectorTypes>
         </soapExtensionReflectorTypes>
         <soapExtensionImporterTypes>
         </soapExtensionImporterTypes>
         <wsdlHelpGenerator href="DefaultSdlHelpGenerator.aspx"/>
      </webServices>
   </system.web>
</configuration>

請參閱

參考

Web 服務設定結構描述

其他資源

ASP.NET Settings Schema
使用 ASP.NET 和 XML Web Service 用戶端建立的 XML Web Service

Footer image

Copyright © 2007 by Microsoft Corporation. All rights reserved.