Export (0) Print
Expand All
3 out of 7 rated this helpful - Rate this topic

How to: Deploy XML Web Services in Managed Code 

When using Visual Studio .NET to create XML Web services in managed code, you use a standard deployment model: you compile your project and then you deploy the resulting files to a production server. The project .dll file contains the XML Web services code-behind class file (.asmx.vb or .asmx.cs) along with all other class files included in your project, but not the .asmx file itself. You then deploy this single project .dll file to the production server without any source code. When the XML Web service receives a request, the project .dll file is loaded and executed.

Compiling and Deploying an XML Web Service in Managed Code

Suppose you have a simple ASP.NET Web Service project named WebService1 that contains the following:

  • An XML Web service entry page named Service.asmx.

  • A code file named Service.vb (or .cs).

When you compile the project, the following occurs:

  • Visual Studio saves all of the files in the project you modified since the last build.

  • Visual Studio copies the Service1.asmx file and the default project files to the development Web server.

  • The Service.vb (or .cs) class file and the Global.asax class file are compiled into the project .dll file, which is then copied to the server in the default \bin directory of the target virtual directory. If the project is set to compile a debug version, Visual Studio creates a project .pdb file in the \bin directory.

    NoteNote

    If compilation errors occur, the deployment will not succeed. For more information, see How to: Debug XML Web Services in Managed Code.

To deploy the XML Web service to a server other than the development server, you can add a Web Setup project or you can copy the required files to the destination server. To make your XML Web service available to others, you will need to deploy it to a Web server that is accessible to the clients you wish to support. For more information, see Deploying Applications and Components and How to: Copy a Project.

To deploy the XML Web service by copying the project

  1. In Solution Explorer, select the project you want to copy.

  2. On the Website menu, click Copy Web Site.

  3. Click the icon next to the Connect to: dropdown box to open the Open Web Site dialog box.

  4. In the Open Web Site box, select the location to which you want to copy the project.

  5. Using the arrow icons, select files from the source web site to copy to the remote web site.

  6. Click Copy Web Site to copy the web site.

After deploying your XML Web service, you need to consider how to make it possible for developers to locate it if you intend others to use it. For more information, see How to: Enable Discovery for XML Web Services.

See Also

Other Resources

Creating XML Web Services in Managed Code
Windows Installer Deployment Walkthroughs
Project Properties (Visual Studio)

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.