Consuming Asynchronous Web Services

Embed Size (px)

Citation preview

  • 8/7/2019 Consuming Asynchronous Web Services

    1/17

    Consuming Asynchronous Web Services

    http://www.15seconds.com/issue/031124.htm

    IntroductionIn this article, we will see how to use Web services in a real-time Web application. Even though Web services arevery powerful and based on open Internet protocols such as XML, HTTP and SOAP (that accounts for platform

    independence), using them in a real-time Web site requires careful consideration of performance implications. For

    example, if before showing a particular page you try to call out two or three Web services across the Internet to get

    data, the responsiveness of the site is going to be severely impacted. At the same time, you cannot avoid calling out

    to Web services to get the data you want. However, if you carefully plan your Web application, you can takeadvantage of the functionalities of the Web services without impacting the performance of the application.

    In this article, we will consider the very common example of a Stock Ticker application and understand how to use

    features such as asynchronous Web services, Windows service applications, server-based timer components, and

    .NET XML API classes to create high-performance, scalable, and flexible applications.

    y download source codeArchitecture of the System

    Our requirement is to get the stock quote from the remote Web service and display the stock quote in different kinds

    of applications such as a Windows form application and a Web form application without affecting the performance.

    The following pieces are tied together to construct this application.

  • 8/7/2019 Consuming Asynchronous Web Services

    2/17

    y The Windows service application that has the timer component invokes the remote Web service in anasynchronous fashion, and it passes the name of the function, which is used to call back once the result is

    returned from the Web service. The called method of the Windows service application then writes the

    retuned stock quote into an XML file. Due to the presence of the Timer component, we carry out the above-

    mentioned action for every pre-determined amount of time. This ensures that we have the latest stock quote

    information in our local XML file. The frequency with which the Web service is invoked is determined bythe value set for the interval property of the timer component.

    y The Windows application displays the stock value by reading the values from the XML file using the XMLclasses contained in the System.Xml namespace. Since the Windows form has a timer control on it, the

    value shown in the form is continuously refreshed based on the interval set in the timer control.

    y The Web form application uses the asp:xml server control to display the stock value from the XML filecreated by the Windows service application. We will discuss in detail the functionality of the asp:xml

    control later in this article.

    Before we look at the code, let me briefly introduce some of the new .NET features like Windows Service, Timer

    Component, ASP:XML server control, and .NET Framework XML API.

    Windows Service

    There are times where you may want to have your code always running on your server. If you have ever workedwith MSMQ, you might have created an application that polls the message queue for every predefined amount of

    time and checks for new messages. In that case, the application that checks the queue for messages should always be

    running as a Windows NT Service to poll the message queue frequently. These Windows services do not have any

    user interface and we can configure Windows services in such a way that they can be automatically started when the

    computer starts, or they can be paused and restarted at any time.

    Prior to Visual Studio .NET, if you wanted to write a Windows service application either you had to use the

    template provided by ATL, or if you are a VB programmer, you had to embed custom NT service controls in VB to

    achieve the same functionality. But with Visual Studio .NET, you can easily create an application that has the

    capability to run as a Service. Visual Studio.NET is supplied with a new project template called Windows Service

    that provides all the plumbing required for creating the application that can run as a Service. When you create a

    Visual Studio .NET project as a Service, you can write code to respond to the actions like what should happen when

    the service is started, paused, resumed and stopped.

    Once you create the service, it has to be installed using InstallUtil.exe (Command line utility), which is used to

    install the service in the local computer. After you install the service, you can start, stop, pause and resume it using

    Service Control Manager.

    Timer Component

    One of the new exciting features in the .NET Framework is the ability to create applications that can raise events at

    scheduled intervals. The Timer component that is contained in the System.Timers namespace is a server-sidecomponent that exposes methods and properties through which we can capture events raised by the Timer

    component and take specific actions according to the requirements.

    You can create an instance of the Timer component by:

    y You can drag an instance of the Timer component from the Components tab of the Toolbox to the designer.y You can create an instance of the Timer component programmatically after importing the namespace

    System.Timers namespace.

  • 8/7/2019 Consuming Asynchronous Web Services

    3/17

    Timer component exposes a property named Interval, the value of which determines the specified interval at which

    the Elapsed event is raised. As the name suggests, the Elapsed event is raised whenever the specified time interval

    expires, and we can write code in this event to implement the custom processing logic that we want to execute.

    In this article, we are going to use the Timer component to raise events at the elapsed intervals that will allow us to

    make a request to a remote Web service in an asynchronous fashion. This frequency of requests is determined by the

    value of the Interval property. It is also important to note that the server-based timer component is different from theWindows-based timer control that is contained in the System.Windows.Forms namespace. Since the server-based

    timer components are designed for use with worker threads in a multithreaded environment, they can be more

    efficient in multithreaded environment unlike their Windows-based counterparts.

    .NET Framework XML API

    The .NET Framework provides a set of XML classes for developers to create applications based on XML. Microsofthas made every attempt to keep the programming model of these classes in line with the ADO.NET programming

    model, which also provides a wealth of functionality to work with XML. These XML classes are contained in the

    System.XML namespace. The methods and properties of the classes present in the System.XML namespace are

    similar to its predecessor, the MSXML parser component. System.XML namespace is likely to replace the MSXML

    parser.

    All the .NET Framework XML classes are derived from two abstract classes called XmlReader and XmlWriter.XmlReader provides a fast, forward-only, read-only cursor for reading an XML document and XmlWriter provides a

    mechanism for producing XML document streams. The output produced by these classes conforms to the W3C

    recommendations. In this article, we will be using XmlTextWriter and XmlTextReader for writing into and reading

    from an XML file.

    For more information on Xml classes in .NET Framework, please take a look at the following article from MSDN.

    XML in .NET: .NET Framework XML Classes and C# Offer Simple, Scalable Data Manipulation.

    ASP:XML Server control

    One of the coolest features of .NET is the ability to apply XSLT transforms to XML data and create HTML on the

    fly. This can be done using the high-performance, built-in server control identified by the tag asp:xml.

    The input XML data to the control can be in any one of the following formats: an object of type

    System.Xml.XmlDocument, an XML string, or an XML file. Similarly the XSL data can be in any one of the

    following formats: an object of type System.Xml.Xsl.XslTransform or an XSL file.

    We will be using the following two properties of the control in the later parts of this article.

    y DocumentSourceIndicates the name of the XML file to be used as input data

    y TransformSourceIndicates the name of the XSL file that contains the transformations to be applied to the XML data

    Implementation of the System

    We will split the whole application into three different parts.

    y Implementation of Web service.y Implementation of Windows service application.

    This Windows service application invokes the Web service asynchronously at scheduled intervals, which is

  • 8/7/2019 Consuming Asynchronous Web Services

    4/17

    determined by the interval property of the Timer component. This application gets the stock quote from the

    Web service, and it stores that value in the XML file named stocks.xml that is created on the fly.

    y Implementation of client applicationsIn this section, we will see how this XML file (that has the updated stock information) can be used by

    different applications. Towards this end, we will consider the following:

    o A WinForms client applicationo

    A Web Forms client application

    Implementation of Web Service

    A Web service can be defined as a programmable logic that is exposed via the Internet using protocols such asHTTP, XML and SOAP. Since Web services are exposed using standard Internet protocols, any application that can

    communicate using these standards can interact with a Web service. Web services provide well-defined interfaces of

    their functionality through an XML based language called Web Services Description Language (WSDL). This

    language not only describes the functionality of the Web service but also describes each of its methods, the

    parameters they take, and their return value. It is similar to the way a COM object exposes its functionalities through

    a type library.

    In this section, we will be implementing a Web service called StockQuoteWebService. This Web service basically

    invokes the stored procedure called StockQuoteGet, which is defined as follows:

    create procedure StockQuoteGet@Name char(4)asselect * from Stockswhere Name = @NameGO

    As you can see, the stored procedure is very simple, and it returns the stock quote from the stocks table based on thename of the company passed in as the argument.

    Here is the code required to implement the Web service.

    using System;using System.Collections;using System.ComponentModel;using System.Data;using System.Diagnostics;using System.Web;using System.Web.Services;using System.Data.SqlClient;

    [WebMethod(EnableSession=false,Description="This Method returns the stock

    quotebased on the name of the company")]public string GetQuote(string name){

    DataSet dstQuote;SqlConnection sqlConn;SqlDataAdapter command;

    DataTable dtStockTable;string connString;string price;

  • 8/7/2019 Consuming Asynchronous Web Services

    5/17

    connString = "server=localhost;uid=sa;pwd=thiru;database=15Seconds";sqlConn = new SqlConnection(connString);command = new SqlDataAdapter("StockQuoteGet", sqlConn);

    command.SelectCommand.CommandType = CommandType.StoredProcedure;

    command.SelectCommand.Parameters.Add(new SqlParameter("@Name",SqlDbType.Char,4));

    command.SelectCommand.Parameters["@Name"].Value = name;

    dstQuote = new DataSet();command.Fill(dstQuote, "Stocks");//Assign the table to the DataTable object variabledtStockTable = dstQuote.Tables["Stocks"];//Return the value present in the Price columnprice = dtStockTable.Rows[0]["Price"].ToString();return price;

    }

    Let us walk through the code line by line to understand the execution of the Web service.

    We start our implementation by importing all the required namespaces.

    using System;using System.Collections;using System.ComponentModel;using System.Data;using System.Diagnostics;using System.Web;using System.Web.Services;

    Since we need to access the Sql Server database to get the stock quote, we import the namespace

    System.Data.SqlClient using the code shown below. This namespace contains all the classes required for accessingSqlServer database using native calls that result in high performance.

    using System.Data.SqlClient;

    The attribute WebMethod specifies that this method is Web-callable and the ASP.NET runtime provides all the

    underlying plumbing required for exposing this method to the Internet clients. We also specify that we do not want

    to store state across requests from a single consumer by setting the EnableSession property to false. The Description

    property allows us to provide a brief description of the functionality of our Web service.

    [WebMethod(EnableSession=false,Description="This Method returns the stockquotebased on the name of the company")]

    In this line, we create an instance of the SqlConnection object, passing to it the connection string that is required to

    establish connection with the database.

    sqlConn = new SqlConnection(connString);

    Once we create an instance of the SqlConnection object, we can then create the SqlDataAdapter object.

    We pass the name of the stored procedure we want to execute and the previously created SqlConnection as

    arguments to the constructor of the SqlDataAdapter object.

  • 8/7/2019 Consuming Asynchronous Web Services

    6/17

    command = new SqlDataAdapter("StockQuoteGet", sqlConn);

    Here, we indicate that we want to execute the stored procedure by setting the CommandType property to Stored

    Procedure.

    command.SelectCommand.CommandType = CommandType.StoredProcedure;

    Since our stored procedure takes the company symbol as an argument, we add the Name parameter in the following

    line.

    command.SelectCommand.Parameters.Add(new SqlParameter("@Name",SqlDbType.Char,4));

    After we add the parameter, we assign the passed name to the Value property of the parameter object.

    command.SelectCommand.Parameters["@Name"].Value = sName;

    dstQuote = new DataSet();

    We then populate the DataSet with the results of the stored procedure execution by invoking the Fill method of theSqlDataAdapter object.

    command.Fill(dstQuote, "Stocks");

    The Tables collection of the DataSet object contains all the tables that are returned as a result of the stored procedure

    execution. From this collection, we retrieve the Stocks table and assign it to the DataTable object using the

    following line of code.

    //Assign the table to the DataTable object variabledtStockTable = dstQuote.Tables["Stocks"];

    Once we get the DataTable object, we can then easily extract the value present in the Price column of and assign it

    to the local variable price.

    //Return the value present in the Price columnprice = dtStockTable.Rows[0]["Price"].ToString();

    Finally, we return the value present in the variable price to the caller.

    return price;

    Implementation of Windows Service Application

    To create a Windows service application in Visual C#, select File->New Project and then select Visual C# Projectsfrom the Project Types and select Windows Service from the List of templates. Enter the name of the project as

    WinPollingService. Once the project is created, rename the default service class from Service1 to

    QuotePollingService.

    The following figure shows the Properties window of our QuotePollingService. Through this window, we can set

    properties such as CanStop and CanShutdown to either true or false. These settings determine what methods can becalled on our service at runtime. For example, when the CanStop property is set to true, the OnStop method will be

    automatically called when the service is stopped through the Service Control Manager.

  • 8/7/2019 Consuming Asynchronous Web Services

    7/17

    Once we set all the properties to appropriate values, we need to add the installers that are required for installing ourWindows service application as a service. To add these installers, we click on Add Installer (shown in the above

    figure) in the Properties window of the QuotePollingService class.

    After we add the installer classes, we need to change the Account property of the ServiceProcessInstaller instance to

    use the LocalSystem account. This is shown in the following diagram.

  • 8/7/2019 Consuming Asynchronous Web Services

    8/17

    Since our Windows service depends on the methods of the StockQuoteService to get the stock quote, we need toreference the Web service that we created in the previous step. In Visual Studio .NET, this is done using the Add

    Web Reference option.

    To add a Web reference, right click on the project in the Solution explorer and select Add Web Reference. In the

    Add Web Reference dialog box, enter the path of the .asmx file of the Web service. When you add a Web referenceof a Web service to your project, Visual Studio .NET automatically generates a proxy class that not only interfaces

    with the Web service but also provides a local representation of the Web service.

    Let us look at the code required to implement our Windows service.

    using System;using System.Collections;using System.ComponentModel;using System.Data;

    using System.Diagnostics;using System.ServiceProcess;using System.Xml;using System.Data.SqlClient;

    public class QuotePollingService : System.ServiceProcess.ServiceBase{private System.ComponentModel.IContainer components;private localhost.QuoteService _service;

  • 8/7/2019 Consuming Asynchronous Web Services

    9/17

    private System.IAsyncResult _asyncResult;private System.Timers.Timer timer1;private string _name;

    static void Main(){

    System.ServiceProcess.ServiceBase[] ServicesToRun;ServicesToRun = new System.ServiceProcess.ServiceBase[] { newQuotePollingService() };

    System.ServiceProcess.ServiceBase.Run(ServicesToRun);}

    protected override void OnStart(string[] args){

    // TODO: Add code here to start your service._name = "MSFT";_service = new localhost.QuoteService();timer1.Enabled = true;

    }

    private void timer1_Elapsed(object sender, System.Timers.ElapsedEventArgs e){

    //Invoke the GetQuote method in asynchronous fashion with the //callbackmethod_asyncResult = _service.BeginGetQuote(_name ,new AsyncCallback(WriteResult),null);

    }

    private void WriteResult(IAsyncResult oRes ){string result;

    result = _service.EndGetQuote(oRes);XmlTextWriter writer = new XmlTextWriter("c:\\Inetpub\\wwwroot\\MyProjects\\15Seconds\\StockWebFormsClient\\stocks.xml",null);

    writer.Formatting = Formatting.Indented;writer.WriteStartDocument(false);

    writer.WriteComment("This file represents the stock quote returned from thewebservice");writer.WriteStartElement("stockquotes");

    writer.WriteStartElement("stockquote", null);writer.WriteStartElement(_name, null);writer.WriteElementString("price", result);

    writer.WriteEndElement();writer.WriteEndElement();writer.WriteEndElement();//Write the XML to file and close the writerwriter.Flush();writer.Close();

    }

    }

  • 8/7/2019 Consuming Asynchronous Web Services

    10/17

    We start by importing all the required namespaces. As you can see, we have also imported the System.Xml

    namespace to get access to the XML related classes.

    using System;using System.Collections;using System.ComponentModel;using System.Data;using System.Diagnostics;using System.ServiceProcess;using System.Xml;using System.Data.SqlClient;

    In the following lines of code, we declare objects of type QuoteService and IAsyncResult.

    private localhost.QuoteService _service;private System.IAsyncResult _asyncResult;

    static void Main(){

    Here, we declare an Array of type ServiceBase.

    System.ServiceProcess.ServiceBase[] ServicesToRun;

    All the services contained by the application can be added and run together. Since we are creating only one service

    named QueuePollingService, we add that to the array.

    ServicesToRun = new System.ServiceProcess.ServiceBase[] { newQuotePollingService() };

    The Run method of the ServiceBase class is the main entry point for the service. In the following line of code, we

    call the Run method and pass the previously created array as an argument.

    System.ServiceProcess.ServiceBase.Run(ServicesToRun);}

    The OnStart method will be executed when the service is started from the Service Control Manager. In this method,we create an instance of our QuoteService, and we also enable the Timer component to let it raise the Elapsed event

    at periodic intervals.

    protected override void OnStart(string[] args){

    // TODO: Add code here to start your service._name = "MSFT";_service = new localhost.QuoteService();timer1.Enabled = true;

    }

    As we already said, the Windows service application has a Timer component that has its interval property set to

    5000 milliseconds. Whenever this interval elapses, the Timer component automatically fires the Elapsed event. Inthis event, we call the BeginGetQuote method of the Web service and pass the company symbol as the first

    argument. We also pass an instance of the AsyncCallback delegate object. To the constructor of the AsyncCallback

    class, we pass the name of the callback method that is to be called back when the asynchronous operation is

    completed, as an argument. The BeginGetQuote method returns an object of type IAsyncResult which can be usedto check the status of the asynchronous operation.

  • 8/7/2019 Consuming Asynchronous Web Services

    11/17

    private void timer1_Elapsed(object sender, System.Timers.ElapsedEventArgs e){//Invoke the GetQuote method in asynchronous fashion with the //callbackmethod_asyncResult = _service.BeginGetQuote(_name ,new AsyncCallback(WriteResult),null);}

    The WriteResult method is called once the Web service finishes its executionm and it is also passes an object of typeAsycnResult that encapsulates the results of the asynchronous Web service call that we made.

    private void WriteResult(IAsyncResult oRes ){string result;

    We get the result by calling the EndGetQuote method, passing to it the AsyncResult object that holds the results of

    the invocation as an argument.

    result = _service.EndGetQuote(oRes);

    Here we create an instance of the XmlTextWriter object and specify the path of the XML file to be created.

    XmlTextWriter writer = new XmlTextWriter("c:\\Inetpub\\wwwroot\\MyProjects\\15Seconds\\StockWebFormsClient\\stocks.xml", null);

    To format the XML Document, we assign the value Indented to the Formatting property of the XmlTextWriter.

    When this option is set, child elements are indented using Indentation and IndentChar properties. IndentChar

    property decides which character to use for Indenting and Indentation property determines how many IndentChars to

    write for each level in the hierarchy. Here we use the default values for Indentation and IndentChar, which are 2 and

    space respectively.

    writer.Formatting = Formatting.Indented;

    We use the StartDocument to write out the XML declaration with the version and the standalone attributes. The

    version attribute will be set to "1.0" and the standalone will have the value "no" as we pass false as an argument to

    the WriteStartDocument method.

    writer.WriteStartDocument(false);

    In this line, we write a Comment to indicate that the QuotePollingService application has created this file.

    writer.WriteComment("This file represents the stock quote returned from theweb service");

    Here we write out the specified start tag with the name of the element as stockquotes.

    writer.WriteStartElement("stockquotes");

    We then write out another element with the name being stockquote.

    writer.WriteStartElement("stockquote", null);

    We add this line of code to create an element with the name as the value contained in the _name variable.

  • 8/7/2019 Consuming Asynchronous Web Services

    12/17

    writer.WriteStartElement(_name, null);

    Finally, we write out an element of type string by invoking the WriteElementString method of the XmlTextWriter

    object.

    writer.WriteElementString("price", result);

    In the following lines, we write out the corresponding end tag elements.

    writer.WriteEndElement();writer.WriteEndElement();writer.WriteEndElement();

    After we are done writing the elements, we flush the contents and then close the XmlTextWriter object.

    //Write the XML to file and close the writerwriter.Flush();writer.Close();

    }

    A sample xml file that is generated by the above code looks like this.

    Now that we have created the Windows service application, let us create a Windows installer to install the Windows

    service. For this purpose, add a new Setup project named WinPollingServiceSetup to the WinPollingService

    solution. Once the setup project is created, add the Project Output of the WinPollingService to the setup project. Youcan do this by right clicking on the WinPollingServiceSetup project from the Solution Explorer and select Add-

    >Project Output from the context menu. In the Add Project Output Group dialog box, select Primary Output from

    the list and click OK. Now that we have added the output of the WinPollingService project to the setup project, we

    then need to add the installer that we created earlier in the WinPollingService project as a custom action. To do this,

    select the WinPollingServiceSetup project from the Solution Explorer and select View->Editor->Custom Actions

    from the menu. In the Custom Actions editor, right click on the Custom Actions folder and select Add CustomAction from the context menu and then select the Primary Output of the WinPollingService project from the dialog

    box.

  • 8/7/2019 Consuming Asynchronous Web Services

    13/17

    Implementation of Client Applications

    Now that we have created the Windows service application that periodically refreshes the contents of the XML file

    with the latest stock quote, we will look at how different applications use this XML file. To illustrate, we will

    consider the following two types applications:

    y A Windows Form applicationy A Web Form application

    We will start our explanation with the Windows form application

    Windows Forms Application We create a new Visual C# Windows application using the New Project dialog box

    and call it StockWinFormsClient. Once the project is created, add a Timer control to the form and set its Interval

    property to 5000. We also add three label controls and name them lblStock, lblName and lblMessage respectively.

    The label control lblStock is the one that displays the stock quote that is obtained from the XML file.

    Since we set the interval property of the Timer control to 5000, the Tickevent of the timer control will be fired for

    every 5000 milliseconds.

    private void timer1_Tick (object sender, System.Timers.ElapsedEventArgs e){try

    {

    Here, we invoke the UpdateDisplay method and pass the name of the XML file to be read as an argument.

    UpdateDisplay("c:\\Inetpub\\wwwroot\\MyProjects\\15Seconds\\StockWebFormsClient\\stocks.xml");

    }catch(Exception ex){

    MessageBox.Show(ex.Message);}

    }

    The UpdateDisplay method loops through the contents of the XML file and identifies the element with the name

    "price" by verifying the NodeType and Name properties of the XmlTextReader object.

    private void UpdateDisplay(string sPath){

    try{

    XmlTextReader reader = new XmlTextReader (sPath);

    while (reader.Read()){if (reader.NodeType == XmlNodeType.Element)

    {if (reader.Name == "price")

    {

    Once the element is identified, we read the contents of the element by invoking the ReadElementString method.

    lblStock.Text = reader.ReadElementString();

  • 8/7/2019 Consuming Asynchronous Web Services

    14/17

    }}

    }reader.Close();

    }catch(Exception ex){

    MessageBox.Show(ex.Message);}

    }

    When we execute this application, we get an output that is similar to the following.

    Web Forms Application

    Now, let us have a look at how we can use the XML file that is created by the Windows service application, to

    display the stock quote information in a Web forms application. Let us start by creating a new Visual C# ASP.NET

    Web application project called StockWebFormsClient. Once we create the project, we add the asp:xml servercontrol to the Web form and set its DocumentSource and TransformSource properties to stocks.xml and stock.xsl

    respectively.

    The entire code of the Web form page named WebForm1.aspx is as follows:

  • 8/7/2019 Consuming Asynchronous Web Services

    15/17

    The above content is generated through the use ofasp:xml server control

    The stocks.xsl file that is used for transforming the contents of the stocks.xml file to html looks like the following.

    MSFT :



    The stock price is obtained from the xml file generated through theasynchronous web service

    If we run the application, we get the following output.

  • 8/7/2019 Consuming Asynchronous Web Services

    16/17

    As we can see from the above figure, the first half of the page is generated by the asp:xml server control, and the

    second half of the page, which has the static display, originates from the parent Web form.

    Putting it all together

    Now that we have constructed the different parts of the application, let us test the application by going through the

    following steps.

    y First, we start the QuotePollingService by opening up the Service Control Manager, right clicking onQuotePollingService and selecting Start from the context menu. Once the service is started, it will keep

    polling the Web service and refresh the contents of the XML file with the latest stock quote value.

    y Now if we run our Windows application by executing the StockWinFormsClient, it will display the lateststock quote from the XML file. If we change the value of the stock quote in the stocks table, the Windows

    form will automatically update its display by showing the new value. This is made possible due to thecombination of the following operations. Firstly, the Windows service application (that is always running)

    continuously invokes the Web service to get the latest stock quote, and it refreshes the XML file with thenew value. Secondly, the Timer control set in the Windows forms application fires the Tick event at pre-

    determined intervals that allows us to read the contents of the XML file at specific intervals and update the

    display.

    y Similarly, we can test our web forms application by navigating to the urlhttp://localhost/MyProjects/15Seconds/StockWebFormsClient/WebForm1.aspx. Since the part of the page

    that contains the stock quote information is generated from the asp:xml server control (which gets its xmldata from the xml file), we always get the updated and accurate stock quote information displayed in our

    browser.

  • 8/7/2019 Consuming Asynchronous Web Services

    17/17

    Conclusion

    In this article, we have seen the following.

    y How to invoke a Web service in an asynchronous fashiony How to create a .NET application that has the capability to run as a Windows Service using Visual Studio

    .NET.y How to use the rich .NET XML classes available in System.XML namespace to write to an .xml file and

    read from an .xml file.

    y How to use the Timer component to raise events at scheduled intervals.Although the application we created was simple in functionality, it should provide a solid foundation for

    understanding how to build high-performance, scalable, flexible and reliable Web applications using some of the

    new features of the .NET framework such as XML based web services, windows service applications, XML API

    classes and the server-based Timer component.