How to make DevExpress XPO caching work over the WebServices?

DXperience has a nice feature of the distributed caching built-in. Essentially this allows the cache to be kept on the client, but the server will tell if it could be used or the refresh is needed.

This approach really makes the applications more responsive over the slow channels.

Unfortunately there’s a drawback: the ICacheToCacheCommunicationCore could not be exposed as a WebServices (at least in 7.3.5) due to a number of reasons:

  • dictionary being used for the table ages does not implement IXmlSerializable (I also wonder why it is non-generic yet)
  • DataCacheCookie can not be passed around since it is can not be serialized to XML either (no default ctor).

There are two quick options to deal with this problem:

  • Fix everything in the sources. This option has better performance and it also brings decent TCO with it (DXperience updates would require merging with your own code).  
  • Wrap the cache communications (TableAgeDictionary, DataCacheCookie and all the results) with your own classes that work, pass those over the web service, and then unwrap on the client side. This one just works.

2007-12-28_172819

Here’s the source for the dictionary wrapper: TableAgeWrapper source

PS: Obviously web services are not the best way to handle the communications in the distributed client-server applications. If the software requirements allow that, then the WCF (binary formatter over the tcp channel) should be used. Unfortunately in this situation this was not the case.

0 Responses to “How to make DevExpress XPO caching work over the WebServices?”


  1. No Comments

Leave a Reply