In a Web service deployment, any assemblies that the Web service uses that are part of the .NET Framework need not be deployed to the IIS Web server. In the Web service that Figure 5, page 4, shows, you can see one assembly fileOrdersWebSvc.dllthat must be deployed into a bin directory off the root of the Web service virtual directory. That file is the only file that the Web service needs to function properly. The OrdersWebSvc.dll fileaka the project .dll filecontains the Web service's code-behind class file (.asmx.vb or .asmx.cs file), which is readable in any text editor and holds the full code and all other class files included in the project. But the OrdersWebSvc.dll file doesn't include the .asmx file itself. For that reason, you must deploy the .asmx file separately. After you deploy the .asmx file, you deploy the single project .dll file to the production server without any affiliated source code. When the XML Web service receives a request, it loads and executes the project .dll file.
Other Files
Now, let's take a look at some files in a Web service deployment. Some files are optional; others simply result from building and deploying the sample Web service in Visual Studio .NET.
.pdb files. A program database (.pdb) file holds debugging and project-state information that permits incremental linking of a Web service's (or ASP.NET application's) debug configuration. Because the developer uses .pdb files in the debugging process, these files aren't necessary in a production deployment of a Web service. In Figure 5, notice the OrdersWebSvc.pdb file that resides in the bin directory.
.disco files and .vsdisco files. Disco, a technology that Microsoft introduced in .NET, facilitates the capability of Web service clients to discover Web services and their associated WSDL documents. If a Web service publishes a static discovery (.disco) file, you can enable programmatic discovery of that Web service. A .disco file defines what files to search; whereas a dynamic discovery (.vsdisco) file simply identifies which directories to omit. The .disco and .vsdisco files provide alternative ways to discover Web services that preclude the use of UDDI. In fact, .disco and .vsdisco files are separate from UDDI; if UDDI is in use, .disco and .vsdisco files aren't.
A file with a .disco extension is an XML document that can contain links to other discovery documents, XML Schema Definition (XSD) schemas, and service descriptions. When a client (e.g., another Web service) requests the default .vsdisco file in a site's root folder, dynamic discovery for the entire Web site begins. Dynamic discovery is a process by which ASP.NET performs an iterative search through a hierarchy of folders on a Web server to locate available Web services.
When you install the .NET Framework on an IIS Web server, .vsdisco extension is mapped to aspnet_isapi.dll and the .NET Framework class System.Web.Services.Discovery.DiscoveryRequestHandler processes any requests for a .vsdisco file. This handler searches the folder that contains the requested .vsdisco fileand all its subfoldersfor Web services (.asmx files), .vsdisco files, and .disco files. If the handler doesn't find an .asmx or .vsdisco file, or if it finds a .disco file, it simply terminates its search. Therefore, you shouldn't (and, in fact, you can't) place both a .vsdisco file and a .disco file in the same folder.
A word of caution: For security reasons, you need to control which XML Web services clients can discover on your IIS Web server. You should use only .vsdisco filesnot .disco fileson development and staging Web servers. When you deploy Web services to production Web servers, you should always create .disco files for the Web services that you want clients to discover.
Web.config files. By including a web.config file in your Web service's default folder, you can provide customization and extensibility and override your IIS Web server's default configuration settings. For example, a web.config file might provide your Web service with custom authentication that's different from your Web site's authentication.
Global.asax files. The .NET equivalent of ASP's global.asa file is the global.asax file, which you can choose to include in your Web service's root folder. Global.asax is an optional, customizable file that contains code for responding to application-level events (e.g., session on_start, session on_end) that a Web service raises.
As Simple as That
Now you know that deploying Web services involves simply copying the Web service .asmx file, some optional files, and any assemblies that the Web service uses to your IIS Web server. So get out there and start deploying.