13.07.2015 Views

Applied XML Programming for Microsoft .NET.pdf - Csbdu.in

Applied XML Programming for Microsoft .NET.pdf - Csbdu.in

Applied XML Programming for Microsoft .NET.pdf - Csbdu.in

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

The SalesReportService.asmx file is located <strong>in</strong> the same virtual folder as the remoteobject. The follow<strong>in</strong>g code shows the implementation of the Sales Report Web service.The ma<strong>in</strong> class is named SalesReportWebService.us<strong>in</strong>g System;us<strong>in</strong>g System.Web.Services;us<strong>in</strong>g System.Data;us<strong>in</strong>g System.Data.SqlClient;us<strong>in</strong>g XmlNet.CS;[WebService(Namespace="xmlnet/cs/0735618011",Name="Northw<strong>in</strong>d Sales Report Web Service",Description="The Northw<strong>in</strong>d Sales Report Web Service")]public class SalesReportWebService{[WebMethod(CacheDuration=60)]public DataSet GetSalesReport(<strong>in</strong>t theYear){SalesDataProvider m_dataManager;m_dataManager = new SalesDataProvider();}DataSet ds = new DataSet();ds.Tables.Add(m_dataManager.GetSalesReport(theYear));return ds;}[WebMethod(CacheDuration=120)]public str<strong>in</strong>g GetSalesReportBarChart(<strong>in</strong>t theYear){SalesDataProvider m_dataManager;m_dataManager = new SalesDataProvider();return m_dataManager.GetSalesReportBarChart(theYear);}The class features two methods—GetSalesReportBarChart and GetSalesReport—thatare simply wrappers around the same methods of the SalesDataProvider class. As wesaw <strong>in</strong> Chapter 12, the SalesDataProvider class provides the implementation ofbus<strong>in</strong>ess logic, <strong>in</strong>clud<strong>in</strong>g the code necessary to draw graphics.465

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!