Workaround with Remoting in CF

  • Thread starter Thread starter Diego F.
  • Start date Start date
D

Diego F.

I know that CF doesn't support .NET Remoting but, does Web Services support
that?

I need a hash table in memory and clients accesing to it. In Windows Forms
it can be solved with remoting and singleton mode, but my clients are Pocket
PCs. The problem with WS is that I can't have the table in memory. Could I
have a kind of service (Windows forms), the web service and the mobile
clients? The idea is that the clients send objects to the WS and it sends
them to the service via remoting. Is that possible?

If not, how could I have a table in memory?

Regards,

Diego F.
 
Diego,

Since the web service would be running on a desktop, then yes it could
support remoting. I would be concerned about performance though, so be sure
to do some testing.
 
web services are typically stateless,
but you can certainly make one stateful.

if you just want to keep a Hashtable around between requests,
then make it static:
static Hashtable ht = new Hashtable();
else you can store it in the Application Cache.
as long as the WS app does not restart,
then your Hashtable will remain in memory.

alot more complicated, but if you want remoting over WS,
then you would want to tweak this:
http://www.codeproject.com/cs/webservices/remotingoverinternet.asp

casey
http://www.brains-N-brawn.com
 
I'm still having problems. In my dll I declare static the hash table and
even the methods to store and retreive the objects from the table, but when
I follow the execution, when my web service calls the method, the table is
empty :-(

Regards,

Diego F.
 
static Hashtable ht = new Hashtable();

[WebMethod]
public void InsertToHashTable(string key, string value)
{
ht.Add(key, value);
return;
}

[WebMethod]
public string GetHashTableValue(string key)
{
return (string) ht[key];
}

casey
http://www.brains-N-brawn.com
 
Back
Top