Deploying XML Web Services 

Deploying a Web service involves copying the .asmx file and any assemblies used by the Web service, but not part of the Microsoft .NET Framework, to the Web server.

For example, suppose you have a Web service named StockServices. To deploy the Web service, you create a virtual directory on your Web server and place the Web service .asmx file in that directory. The virtual directory should also be an Internet Information Services (IIS) Web application, although it is not required. A typical deployment would have the following directory structure:

\Inetpub

     \Wwwroot

          \StockServices

               StockServices.asmx

               \Bin

                    Assemblies used by your Web service that are not part of the Microsoft .NET Framework.

Items Published with a Web Service

When you publish a Web service, the following items are deployed to a Web server.

Item Description

Web application directory

Acts as the root directory for your Web service. All the remaining files are placed within this directory.

This directory should be flagged as an IIS Web application.

<MyXMLWebService>.asmx file

Acts as the base URL for clients that are calling the Web service. The name of the file can be any valid file name.

<MyXMLWebService>.disco file

(Optional) Acts as a discovery mechanism for the Web service. The .disco file is not automatically created for a Web service. For information about creating a discovery file for your Web service, see How to: Enable Discovery for XML Web Services. The name of the file can be any valid file name.

Web.config file

(Optional) If you need to override the default configuration settings, you can include a Web.config file. Web services use the configuration file to allow customization and extensibility of the system.

For example, you might supply a Web service–specific Web.config file if your Web service requires authentication, but other Web applications on the system do not.

\Bin directory

Contains the binary files for the Web service. If your Web service class is not in the same file as the .asmx file, then the assembly containing the class must be in the \Bin directory.

See Also

Tasks

How to: Enable Discovery for XML Web Services

Concepts

Configuration Options for XML Web Services Created Using ASP.NET

Other Resources

XML Web Services Using ASP.NET