|
using System;
using System.Collections;
using System.ComponentModel;
using System.Diagnostics;
using System.Web;
using System.Web.Services;
using System.Xml;
using System.Data;
namespace RSTestWS
{
/// <summary>
/// Summary description for BusinessData.
/// </summary>
public class BusinessData : System.Web.Services.WebService
{
public BusinessData()
{
//CODEGEN: This call is required by the ASP.NET Web Services Designer
InitializeComponent();
}
#region Component Designer generated code
//Required by the Web Services Designer
private IContainer components = null;
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if(disposing && components != null)
{
components.Dispose();
}
base.Dispose(disposing);
}
#endregion
// WEB SERVICE EXAMPLE
// The HelloWorld() example service returns the string Hello World
// To build, uncomment the following lines then save and build the project
// To test this web service, press F5
[WebMethod]
public DataSet GetReportDataSet(string sXml)
{
// parse xml
// call business component based on method defined in xml
DataSet ds = null;
try
{
string sWebMethod = string.Empty;
XmlDocument doc = new XmlDocument();
doc.LoadXml(sXml);
sWebMethod = doc.SelectSingleNode("//WebMethod").InnerText;
BusinessDataAccess DataAccess = new BusinessDataAccess();
switch (sWebMethod)
{
case "GetCustomers":
ds = DataAccess.GetCustomers(sXml);
break;
case "GetTerritorySales":
ds = DataAccess.GetTerritorySales(sXml);
break;
case "GetSalesOrder":
ds = DataAccess.GetSalesOrder(sXml);
break;
case "GetSalesOrderDetail":
ds = DataAccess.GetSalesOrderDetail(sXml);
break;
}
}
catch
{
}
return ds;
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
Years of software consulting and software development using Microsoft development products such as Microsoft Content Management System, SQL Server Reporting Service, ASP.Net C# VB.Net, HTML and javascript web development, Visual Studio add-on development, C++ MFC/ATL and COM+ development, and ActiveX components.