[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

BillyM

1/10/2003 2:10:00 AM

Here is the issue I have, there seems to be something wrong here. Everytime
I access the webservice it does not have access to the ds that was created
with the application call in the global.asax. I want to be able to handle
all read and write methods to the xml file/dataset at the application level
so that I dont have a problem with file locks when multiple clients call
write methods of the webservice. Is there a better way. My goal is to manage
all user, info and messages within a single xml file that contains the
schema & data. I am fairly new to web services and kinda need all the help I
can get. My concern is having problems with the dataset writing back to the
file while multiple users are submitting info.



This is what I have.

in my global.asax file:
<object id="ds" runat="server" classid="DataService.DataManager"
scope="application"/>

in my DataService.dll (SourceCode):

using System;
using System.Data;
namespace DataService
{
public class DataManager
{
public DataManager()
{
DataSet ds = new DataSet();
ds.ReadXml(Server.MapPath(@"db/xmldb.xml",XmlReadMode.Auto);
}
public DataSet GetData()
{
return ds
}
}
}

in my WebService.dll (asmx SourceCode):


using System;
using System.Web.Services;

using System;
using System.Data;
using System.Web.Services;

namespace WebService
{
public class ServiceManager : WebService
{
public ServiceManager()
{
}
public DataSet GetGlobalDataSet()
{
return ds
}
}
}