Microsoft KB Archive/815150

= HOW TO: Limit the Web Services Protocols that a Server Permits =

Article ID: 815150

Article Last Modified on 5/13/2007

-

APPLIES TO


 * Microsoft ASP.NET 1.0
 * Microsoft ASP.NET 1.1
 * Microsoft Web Services Enhancements for Microsoft .NET 2.0
 * Microsoft Web Services Enhancements for Microsoft .NET 1.1

-



IN THIS TASK

 * SUMMARY
 * Disable Web Services Protocols
 * REFERENCES



SUMMARY
This step-by-step article describes how to limit the protocols that a Web service supports.

XML–based Web services exchange XML documents to communicate. This exchange can occur across any type of application-layer protocol. By default, ASP.NET Web services are exposed through four different protocols: HttpSoap, HttpPost, HttpGet, and Documentation. In many cases, only a subset of these four protocols is required. For example, Web services typically use only the HttpSoap protocol for communications. In these circumstances, if you remove the unused protocols, you increase the security of the application by decreasing the attack surface. This article describes how to disable Web services protocols that are used to communicate with an ASP.NET application.

back to the top

Disable Web Services Protocols
To disable a Web Services protocol for an ASP.NET application, follow these steps:  Open the Web.config file in a text editor (such as Notepad). The Web.config file is located in the root folder of you Web service application. Add the  configuration element under the  element. In the  element, add the configuration element. In the element, add a element for each default protocol that you want to disable. In each of the elements that you created in step 4, set the name attribute to the name of a protocol that you want to disable.  By default, the HttpPost, HttpSoap, HttpGet, and Documentation protocols are enabled. The following example of the <webServices> configuration element disables all default protocols except HttpSoap: <webServices> <remove name=&quot;HttpPost&quot;/> <remove name=&quot;HttpGet&quot;/> <remove name=&quot;Documentation&quot;/> </webServices> </li> Save the Web.config file. The Web service will restart automatically, and will return error messages for all requests that are in disabled protocols.</li></ol>

back to the top

<div class="references_section">