Web services are applications through which one can provide different kinds of online services to the web user. These services are hosted on the Internet and can be accessed by authorized users to embedded on their web site. There are a number of web service providers such as Google that provide a host of web services: for eg, the Google search engine can be incorporated into your web site. Windows Live is another such service that lets you incorporate Win¬dows Live Services to your web site, Win¬dows Live Contact Service shows users' contact list, Windows Live Messenger al¬lows for chatting within the Internet browser and authentication with Windows Live !D. Another example is 'Amazon.com' that allows you to develop a customized application which can search details of products without even visiting the website.

So, why should you implement web services within your website. Well, they reduce your time and effort spent in do¬ing the same job twice and making things a lot easier for visitors to the website. For example if you want to show the local weather report on your website it won't be feasible for you to stand under the open sky and study weather patterns. On top of it, you'll have to update the temper¬ature continuously on your web site. So, what you can do instead is to have a weather status widget on your website so that you can use the service provided by any weather reporting website to your own website.

Likewise you can have a currency converter within your website which takes the currency value right from the local stock exchange. Web Serv.ices works on three different platforms: 1. SOAP: Simple Object Access Proto¬col is based on XML and is both lan¬guage and platform independent.

2. WSDL: Web Service Description Language which is also based on the XML but is basically used to describe the web service and how you can ac¬cess it.
3. UDD!: Universal Description, Dis¬covery and Integration is a directory service that is used where one can register and then search for web serv¬ices. UDD! uses SOAP to communi¬cate and is built into the MS .NET platform.

Now let's see how you can make your own web service in ASP.NET AJAX and also how you can make use of it at the client side. For creating this we shall use Visual Web Developer 2008. Start with creating a new web service and click on File> New Web Site and select the ASP.NET web service template. Now click on the browse button. Select the local lIS tab on the left hand side and then add a new web service to it.

Give a meaningful name to the web service and click on 'Ok'. As soon as the development environment gets ready, you shall see a web service automatically created. Delete the pre-created service and start the process for creating your own web service. For deleting, right click on the 'service.asmx' file listed on the right side; also delete the code associated with 'service.asmx', i.e. the 'service. vb' file. Now create a new web service by right clicking on the website and then click on 'Add new' item; select the web service option,give a suitable name and click on Add. Once the new service has been added, find the line:

"To allow this Web Service to be caLLed from script, using ASP.NET AJAX, un¬comment the following Line:"
'<System. Web.Scri pt. Services. ScriptServiceO>
You need additional attributes to use this web service, so 'uncomment' the above line. Now we shall explicitly men¬tion the namespace and keep every sin¬gle code inside this names pace. An example of the code is shown below:

Imports System.Web
Imports System.Web.Services
1m ports System. Web.Services. ProtocoLs Namespace pcquest.webservice
'all the code inside this section End Namespace After this double click on the'ser¬vice.asmx' file and replace the class name service with the name of the names pace i.e. pcquest.webservice. The line in service.asmx file should like this:
"<%@ WebService Language="vb" Code¬Behi nd-" - / Ap p_ Code/Service. vb" CLass-"pcquest.webservice" %>"
Once this is done, right click on the service.asmx file and view it on Internet Explorer. It should show the web service page; click on the invoke button on the web page to test the web service.

Now it's time for client side coding.
For this close the current Web Developer 2008 project and start a fresh project. This time we will be creating a new ASP.NET AJAX website. Provide a suit¬able name and click on Ok.As the page appears we see a couple of standard code already written.

We shall modify those codes accord¬ing to our needs. First give a title to your web page, for eg, 'Website for testing web services' and then delete everything that is inside the 'Body' tag. Place the follow¬ing code inside the body:
<form id="forml" runat = "server"> <asp:ScriptManager runat = "server"> <Services>
<asp:ServiceReference Path -
''http://LocaLhost/webservice/Service.as mx" />
</Services>
</asp:Scri ptManager>

<button id="heLLo" oncLick = "caLLserviceO"> Click </button> </form>
And in the 'head' tag place these two functions:
<script type -"text/javascript"> function caLlservice 0 {pcquest. webservice.service. heLLo ( caLlcompLete)
} function caLlcomplete(textrecived) { aLert(textrecived )
And that's all, save your project and view your client web page on the web browser. Now click on the button which is on the web page and you will get an alert which says 'Hello'. Similarly you can use this to retrieve the status of some process or project. Web services can also be used to re¬trieve any data from the database and deliver the required data to the client side.