Working with Web Services Using ASP.NET
page 4 of 11
Average Rating: 
Views (Total / Last 10 Days): 58854/ 116

The Web Service Attribute

The Web Service Attribute is a member of the System.Web.Services namespace.  This we can use to let the clients know where to find information about a Web Service.  There are three properties of the Web Service attribute.  They are as follows:

1.      Description

2.      Namespace

3.      Name


The Description property is used to provide a brief description of the functionality of the class.  We can write the same as specified in Listing 2.

Listing 2

[WebService(Description="This class contains methods for working with Addition of numbers and Population of DataSet")]


The Namespace property sets the XML namespace for the service.  Generally we use an URL.  It does not have to be an actual URL; it can be any string value.  The idea is that it should be unique.  It is common practice to use URL because a URL is always unique.


When the WSDL is generated for an ASP.NET Web Service, the name of the class is used for the service name within the WSDL.  When a proxy uses the WSDL and builds a proxy class, the name of the class generated corresponds to the name value of service.  This property allows overriding the default value.

View Entire Article

User Comments

No comments posted yet.

Product Spotlight
Product Spotlight 

Community Advice: ASP | SQL | XML | Regular Expressions | Windows

©Copyright 1998-2024  |  Page Processed at 2024-06-22 10:45:51 PM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search