控制 ASP.NET Web 服务及其客户端的行为。默认情况下,webServices 元素和其子代应用于配置所应用的任何 Web 服务或代理类。
注意 |
|---|
|
在 .NET Framework SDK 主要配置节中的 |
??system.web 元素(ASP.NET 设置架构)
????
<webServices>
<conformanceWarnings>...</conformanceWarnings>
<protocols>...</protocols>
<soapEnvelopeProcessing.../>
<serviceDescriptionFormatExtensionTypes>...
</serviceDescriptionFormatExtensionTypes>
<soapExtensionImporterTypes>...</soapExtensionImporterTypes>
<soapExtensionReflectorTypes>...</soapExtensionReflectorTypes>
<soapExtensionTypes>...</soapExtensionTypes>
<soapServerProtocolFactoryType.../>
<soapTransportImporterTypes>...</soapTransportImporterTypes>
<wsdlHelpGenerator.../>
</webServices> |
属性和元素
以下几节描述了属性、子元素和父元素。
属性
无。
子元素
| 元素 | 说明 | ||
|---|---|---|---|
|
conformanceWarnings |
可选的元素。 定义将用于验证 Web 服务的 WS-I 配置文件集合。
|
||
|
protocols |
可选的元素。 指定传输协议,ASP.NET 可使用这些传输协议来解密 HTTP 请求中从客户端浏览器发送的数据。在对 XML Web services 的 HTTP 请求中发送的数据可以包含方法调用和参数。 |
||
|
serviceDescriptionFormatExtensionTypes |
可选的元素。 指定要在配置文件的范围内运行的服务描述格式扩展。 |
||
|
soapExtensionImporterTypes |
可选的元素。 指定当访问配置文件范围内的 XML Web services 的服务描述以创建代理类时将运行的 SOAP 扩展。 |
||
|
soapExtensionReflectorTypes |
可选的元素。 指定当为配置文件范围内的所有 XML Web services 生成服务描述时将运行的 SOAP 扩展。 |
||
|
soapExtensionTypes |
可选的元素。 指定要与配置文件范围内的所有 XML Web services 一起运行的 SOAP 扩展。 |
||
|
soapServerProtocolFactoryType |
可选的元素。 设置一个 |
||
|
soapTransportImporterTypes |
可选的元素。 设置一个表示 |
||
|
wsdlHelpGenerator |
可选的元素。 当浏览器直接定位到 .asmx 页时向该浏览器显示的 XML Web services 帮助页(.aspx 文件)。 |
父元素
| 元素 | 说明 |
|---|---|
|
configuration |
公共语言运行库和 .NET Framework 应用程序所使用的每个配置文件中均需要的根元素。 |
|
system.web |
指定配置文件中 ASP.NET 配置设置的根元素。包含各种配置元素,这些配置元素配置 ASP.NET Web 应用程序并控制这些应用程序的行为方式。 |
备注
在
默认配置
下面的默认 webServices 元素在 .NET Framework 版本 1.1 中的计算机配置文件内配置。
| ? | 复制代码 |
|---|---|
<webServices>
<protocols>
<add name="HttpSoap1.2"/>
<add name="HttpSoap"/>
<add name="HttpPostLocalhost"/>
<add name="Documentation"/>
</protocols>
<soapExtensionTypes>
</soapExtensionTypes>
<soapExtensionReflectorTypes>
</soapExtensionReflectorTypes>
<soapExtensionImporterTypes>
</soapExtensionImporterTypes>
<wsdlHelpGenerator href="DefaultWsdlHelpGenerator.aspx"/>
<serviceDescriptionFormatExtensionTypes>
</serviceDescriptionFormatExtensionTypes>
</webServices> | |
下面的默认 webServices 元素在 .NET Framework 版本 1.0 中的计算机配置文件内配置。
| ? | 复制代码 |
|---|---|
<webServices>
<protocols>
<add name="HttpSoap"/>
<add name="HttpPost"/>
<add name="HttpGet"/>
<add name="Documentation"/>
</protocols>
<soapExtensionTypes>
</soapExtensionTypes>
<soapExtensionReflectorTypes>
</soapExtensionReflectorTypes>
<soapExtensionImporterTypes>
</soapExtensionImporterTypes>
<wsdlHelpGenerator href="DefaultWsdlHelpGenerator.aspx" />
<serviceDescriptionFormatExtensionTypes>
</serviceDescriptionFormatExtensionTypes>
</webServices> | |
下面的默认 webServices 元素不是在计算机配置文件或根 Web.config 文件中显式配置的,而是由 .NET Framework 版本 2.0 中的应用程序返回的默认配置。
| ? | 复制代码 |
|---|---|
<webServices>
<conformanceWarnings>
<add name = "None" />
</conformanceWarnings>
<protocols>
<add name = "Unknown" />
</protocols>
<soapEnvelopeProcessing readTimeout = "" />
<serviceDescriptionFormatExtensionTypes>
<add type = "" />
</serviceDescriptionFormatExtensionTypes>
<soapExtensionImporterTypes>
<add type = "" />
</soapExtensionImporterTypes>
<soapExtensionReflectorTypes>
<add type = "" />
</soapExtensionReflectorTypes>
<soapExtensionTypes>
<add group = "Low"
priority = "0"
type = "" />
</soapExtensionTypes>
<soapServerProtocolFactoryType type = "" />
<soapTransportImporterTypes>
<add type = "" />
</soapTransportImporterTypes>
<wsdlHelpGenerator href = "DefaultWsdlHelpGenerator.aspx" />
</webServices>
<webServices>
<conformanceWarnings>
<clear />
<add name="BasicProfile1_1" />
</conformanceWarnings>
<protocols>
<clear />
<add name="HttpSoap12" />
<add name="HttpSoap" />
<add name="HttpPostLocalhost" />
<add name="Documentation" />
</protocols>
<serviceDescriptionFormatExtensionTypes>
<clear />
</serviceDescriptionFormatExtensionTypes>
<soapEnvelopeProcessing readTimeout="2147483647" />
<soapExtensionImporterTypes>
<clear />
</soapExtensionImporterTypes>
<soapExtensionReflectorTypes>
<clear />
</soapExtensionReflectorTypes>
<soapExtensionTypes>
<clear />
</soapExtensionTypes>
<soapTransportImporterTypes>
<clear />
</soapTransportImporterTypes>
<wsdlHelpGenerator href="DefaultWsdlHelpGenerator.aspx" />
<soapServerProtocolFactory type="System.Web.Services.Protocols.SoapServerProtocolFactory, System.Web.Services,
Version=2.0.0.0, Culture=neutral PublicKeyToken=b03f5f7f11d50a3a" />
</webServices> | |
示例
下面的示例关闭整个 ASP.NET 网站的 Basic Profile 1.1 一致性警告。
| ? | 复制代码 |
|---|---|
<configuration>
<system.web>
<webServices>
<conformanceWarnings>
<remove name='BasicProfile1_1'/>
</conformanceWarnings>
</webServices>
</system.web>
</configuration> | |
元素信息
|
配置节处理程序 |
|
|
配置成员 |
|
|
可配置的位置 |
Machine.config 根级别的 Web.config 应用程序级别的 Web.config 虚拟或物理目录级别的 Web.config |
|
要求 |
IIS 5.0、IIS 5.1 或 IIS 6.0 .NET Framework 1.0、1.1 或 2.0 Visual Studio 2003 或 Visual Studio 2005 |
请参见
任务
参考
system.web 元素(ASP.NET 设置架构)
configuration 元素(常规设置架构)
概念
其他资源
常规配置设置 (ASP.NET)ASP.NET 配置设置
注意