Share via


<add> Element for <protocols>

This topic is specific to a legacy technology. XML Web services and XML Web service clients should now be created using Windows Communication Foundation.

Adds a specified protocol 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.

Schema Hierarchy

<configuration>
  <system.web>
    <webServices> Element
      <protocols> Element
        <add> Element for <protocols>

Syntax

<add name="protocol name"/>

Attributes and Elements

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

Attributes

Attribute Description

name

Required attribute.

The name of the protocol to add.

Child Elements

None.

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. Contains configuration elements that configure ASP.NET Web applications and control how the applications behave.

webServices

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

protocols

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.

Remarks

All four possible protocols make use of HTTP/1.1 (Hypertext Transfer Protocol) as their transport. Literally, the HttpGet and HttpPost protocol values use the GET and POST methods of HTTP. The HttpSoap value also uses the POST method, but without the traditional HTTP POST semantics used by an HTML form.

Example

The following example enables all four supported protocols.

<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
<protocols> Element

Other Resources

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