471,091 Members | 1,519 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,091 software developers and data experts.

webservice based on large XML file as datasource

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
-=-
Nov 18 '05 #1
3 1778
SF
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

"Tarun Jain" <tj***@hotmail.com> wrote in message
news:a3*************************@posting.google.co m...
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
-=-

Nov 18 '05 #2
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)

"Tarun Jain" <tj***@hotmail.com> wrote in message
news:a3*************************@posting.google.co m...
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
-=-

Nov 18 '05 #3
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
-=-

-----Original Message-----
Tarun,

have you considered reading it in a DataSet and then use DataViewsto do the querying? Or you could read it in a XMLDocument and thenuse XPath to access the specific elements you are looking for.
In any case I'd put the data structure you use for in- memory storagein the application cache and use a CacheDependency to keep
the original XML file and the in-memory data in sync.

Hope that helps
Stefan

"Tarun Jain" <tj***@hotmail.com> wrote in message
news:a3*************************@posting.google.c om...
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
-=-

.

Nov 18 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by ohaya | last post: by
6 posts views Thread by guillaume | last post: by
reply views Thread by pruebauno | last post: by
7 posts views Thread by Joseph | last post: by
3 posts views Thread by Charlie | last post: by
6 posts views Thread by Thomas Due | last post: by
1 post views Thread by David | last post: by
2 posts views Thread by robert | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.