webservice based on large XML file as datasource

  • Thread starter Thread starter Tarun Jain
  • Start date Start date
T

Tarun Jain

Hi,
I am trying to create a WebService which uses data stored in a large
xml file (200-400 MB). Obviously parsing the xml for every webservice
request is not feasible since that would make the response very slow.

What should I do to make sure that I can load the xml file once and
keep it in memory. Then I should be able to use the same in-memory
parsed xml document.

Thanks

Tarun
-=-
 
Tarun,

have you considered reading it in a DataSet and then use DataViews
to do the querying? Or you could read it in a XMLDocument and then
use XPath to access the specific elements you are looking for.

In any case I'd put the data structure you use for in-memory storage
in the application cache and use a CacheDependency to keep
the original XML file and the in-memory data in sync.

Hope that helps
Stefan
 
you just store in a static (shared in vb). while accessing a dom is
threadsafe, updating is not. you will need to supply locking for your
threads. if you need to a lot of updates. then you will not want to lock the
whole doms, but rather lock at the lowest node you need.

-- bruce (sqlwork.com)
 
Thanks for your input so far.

A more complete description of the problem is that

--> I have to only read the data. There are no updates to
the xml document that are required.

--> I am planning to use XPath to retrieve the data.

--> I am planning to use the cache. But the problem is
that this web service will not see a lot of traffic,
something like 10 queries a day. I know that ASP.NET shuts
down the application when there are no more sessions.
So what will happen is that if I cache the XmlDocument
object, once the application shuts down the cache will
disappear along with it.

What can I do to get around these problems ??

Tarun
-=-
 
Back
Top