I'll preface this by saying that I've been developing in .NET for many years, and VB/BASIC for many years before that, but my background is mostly in desktop applications and system interfaces - I'm still pretty new to all this web application stuff, so I apologize up front if this is a silly question.
That said, here's my question: when you create an object in an ASPX page and store it in cache, how can you access it from an ASMX web service that resides in the same application?
To further elaborate: I have a single web application which includes ASPX pages, an ASMX web service, and a class library consisting of two object classes. When the user signs in to the application, they configure some settings, and the objects are created and stored in a system.Web.Caching.Cache object. The custom objects are then pulled out of cache on the next page, and the user then makes an AJAX call (via jQuery) to the web service to retrieve some data.
The problem is that in the web service response, I need to parse the returned data based on the content of the user-created objects stored in the web application's cache. However, I can't find any way to access the cached object from inside the web service.
I have a sneaking suspicion that it may be possible to serialize my custom .NET objects into JSON objects and pass them via the AJAX call to the web service for deserialization, but frankly, I would have no idea how to even begin at that. Plus the objects are potentially 30 - 40K in size, and the AJAX call is being made as frequently as once every 3 seconds, so I'd really like to avoid the overhead of passing all that extra data with each call, especially since the data I need is already sitting in memory in the application where the web service resides.
So once again, I ask: when you create an object in an ASPX page and store it in cache, how can you access it from an ASMX web service that resides in the same application?
Is this making sense? Am I crazy? Missing something obvious? Any insight anyone can provide would be VERY highly appreciated. Thanks!