Condividi tramite


<protocols> Element 

Specifies the protocols that an ASP.NET Web service can use to receive request data sent from a client and return response data. A protocol can be used to associate request data with a method and its parameters and to associate response data with the method and its return value.

<protocols> 
   <add name="protocolname"/>
   <remove name="protocolname"/>
   <clear>   
</protocols>

Attributes and Elements

The following sections describe attributes, child elements, and parent elements.

Attributes

None.

Child Elements

Element Description

add

Adds a specified protocol that an ASP.NET Web service can use to receive request data sent from a client and return response data. By default, only HttpSoap and Documentation are enabled.

clear

Removes all protocols from within the scope of the configuration file.

remove

Removes a specified protocol for handling request and response data from within the scope of the configuration file.

Parent Elements

Element Description

configuration

The root element in every configuration file used by the common language runtime and .NET Framework applications.

system.web

Specifies the root element for the ASP.NET configuration section.

webServices

Controls the settings of Web services deployed using ASP.NET and of Web service clients running on the .NET Framework.

Example

The following example enables all four supported protocols. By default, only HttpSoap and Documentation are enabled. To use HttpPost and HttpGet, you need to enable them as showed in the example below.

<configuration>
   <system.web>
      <webServices>
         <protocols>
            <add name="HttpSoap"/>
            <add name="HttpPost"/>
            <add name="HttpGet"/>
            <add name="Documentation"/>
         </protocols>
      </webServices>
   </system.web>
</configuration>

See Also

Reference

<webServices> Element

Other Resources

ASP.NET Configuration Settings
XML Web Services Created Using ASP.NET and XML Web Service Clients
ASP.NET Configuration