Wow, I just figured out some cool stuff thanks to Ken Kolda in
m.p.d.f.remoting
Now I have my multiuser XmlDocument set to load once at startup using a
static invocation of a class.
Next I'll apply my mutex and build out the Xpath query methods (!)
public class xmlPoolDoc
{
XmlDocument xd = new XmlDocument();
public xmlPoolDoc(XmlReader xr)
{
//
// TODO: Add constructor logic here
//
xd.Load(xr);
}
public void insertNodes()
{
}
public string selectNodes()
{
return xd.InnerText;
}
public void updateNodes()
{
}
public void deleteNodes()
{
}
}
public class DataBourse : System.Web.Services.WebService
{
static XmlTextReader reader = new XmlTextReader (@"c:\xmlbase\pool.xml");
static xmlPoolDoc xPdoc = new xmlPoolDoc(reader);
static DataBourse()
{
//doc.Load(reader);
}
public DataBourse()
{
//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 string HelloWorld()
// {
// return "Hello World";
// }
[WebMethod]
public string SelectFromPool(string query)
{
return xPdoc.selectNodes();
}
[WebMethod]
public string UpdateSelectedNodeInPool()
{
return "Hello World";
}
[WebMethod]
public string InsertNewNodeAtPointInPool()
{
return "Hello World";
}
}