views:

215

answers:

1

Hi,

I'm writing a mock of a third-party web service to allow us to develop and test our application.

I have a requirement to emulate functionality that allows the user to submit data, and then at some point in the future retrieve the results of processing on the service. What I need to do is persist the submitted data somewhere, and retrieve it later (not in the same session). What I'd like to do is persist the data to a database (simplest solution), but the environment that will host the mock service doesn't allow for that.

I tried using IsolatedStorage (application-scoped), but this doesn't seem to work in my instance. (I'm using the following to get the store...

IsolatedStorageFile.GetStore(IsolatedStorageScope.Application | 
    IsolatedStorageScope.Assembly, null, null);

I guess my question is (bearing in mind the fact that I understand the limitations of IsolatedStorage) how would I go about getting this to work? If there is no consistent way to do it, I guess I'll have to fall back to persisting to a specific file location on the filesystem, and all the pain of permission setting that entails in our environment.

Thanks in advance.

A: 

Self-answer.

For the pruposes of dev and test, I realised it would be easiest to limit the lifetime of the persisted objects, and use

HttpRuntime.Cache

to store the objects. This has just enough flexibility to cope with my situation.

ZombieSheep