In this article we will learn how to deploy a web service. The steps and processes involved in deployment of web services are similar to those for web applications. The first difference is while we upload .asmx file in web service deployment, in case of web applications, we upload .aspx files. Commonly, we deploy three files. When uploading web services.
.XSD files - XML Schema Definition files
Note: if a web service has dependencies in the form of dynamic link libraries(*.dll), these files also needs to be deployed.
we have seen how to create .asmx file in the article “creating a web service in visual studio.net". A .asmx file is the entry file for a web service. The functionality of the web service application is listed in the .asmx file. Uploading this file is as simple as uploading a .aspx file. A ftp program can be used to upload the .asmx file on to the web host.
.disco file - Discovery file
.disco files are also known as discovery files help developers to find web services which are available on a particular web site. Note the difference. To find web service listed on different web sites, we need to access the UDDI - universal discovery description integration. Also note that a single disco file located on a web site lists all web services available on that web site.
Once a developer finds a web service using the discovery file, they can query the WSDL contained in the web service file. Developers use this discovery file when they add a web reference to their applications. After adding a web reference, they can view the contents of the file in the Add Web reference dialog box provided by Visual Studio.Net. They can choose WSDL file of the service from the list.
How to create discovery files
When visiting a web service through the browser, the ASP.NET engine displays an information page about the web service and its methods.
The below link displays the WSDL document.
You can create static discovery files by browsing to your web service and appending the ?DISCO query string to the URL. The below link displays the disco file.
The resulting XML can be saved as a .disco file. The following example illustrates the contents of a static discovery file for the HelloWorld web service.
The important aspects of .disco files are
The element contains the location of the information about a web service. This is usually an URL. Before deploying a web service we need to ensure that the information contained in the section is changed from the development server to the production server.
When we create our second and third web services, we can update the same discovery file with element for each additional web service. A common way to add these elements to a DISCO file is to browse each of the web services with “?DISCO" query string and copy the element into the discovery file.
We need to deploy this .disco file into the web sites root directory, which will make it easy for developers to find all the web services available on the web site.
Xsd files are XML schema files are documents that are used to define and validate the content and structure of XML data. Recall that a database schema defines and validates the tables, columns, and data types of a database. XML schemas are similar to database schemas and are stored in XML schema definition (XSD) files.
xsd files are deployed only when XML web services can pass data in the form of XML datasets. Developers can also browse the schema definitions just like DISCO file from the Add Web Reference dialog box in Visual Studio. net, by clicking on the view schema link.