R
Robin Mark Tucker
Hi, apologies for the cross post, if you also subscribe to the
aspnet.webservices group, I'm new to asp.net so I'm still finding the
newsgroup sweet spots
Anyway, my question is, how can I store state on the server for each
instance of a proxy I use on my
client?
For example if I have, say, as hash table in my services.vb class, with a
web method that creates it:
private m_Hash As Dictionary(Of String, Integer)
<WebMethod()> _
Public Sub CreateHash()
m_Hash.Clear()
m_Hash = new Dictionary(Of String, Integer)
End Sub
<WebMethod()> _
Public Sub AddToHash(ByVal theString as String, ByVal theInteger As
Integer)
m_Hash.Add ( theString, theInteger)
End Sub
and then in my VB.NET (Windows Forms) client application, instantiate the
generated proxy class:
Dim m_Proxy As New MYSERVICE.service
m_Proxy.CreateHash ()
m_Proxy.AddToHash ( "Example", "1" )
Will the hashtable created in the service when "CreateHash" is executed
still be there when "AddToHash" is executed? As m_Proxy is client side, I'm
wondering if an instance of the service class on the server exists for as
long as it does. What is the "best" practice way to store state like this?
Thanks
Robin Tucker
aspnet.webservices group, I'm new to asp.net so I'm still finding the
newsgroup sweet spots
Anyway, my question is, how can I store state on the server for each
instance of a proxy I use on my
client?
For example if I have, say, as hash table in my services.vb class, with a
web method that creates it:
private m_Hash As Dictionary(Of String, Integer)
<WebMethod()> _
Public Sub CreateHash()
m_Hash.Clear()
m_Hash = new Dictionary(Of String, Integer)
End Sub
<WebMethod()> _
Public Sub AddToHash(ByVal theString as String, ByVal theInteger As
Integer)
m_Hash.Add ( theString, theInteger)
End Sub
and then in my VB.NET (Windows Forms) client application, instantiate the
generated proxy class:
Dim m_Proxy As New MYSERVICE.service
m_Proxy.CreateHash ()
m_Proxy.AddToHash ( "Example", "1" )
Will the hashtable created in the service when "CreateHash" is executed
still be there when "AddToHash" is executed? As m_Proxy is client side, I'm
wondering if an instance of the service class on the server exists for as
long as it does. What is the "best" practice way to store state like this?
Thanks
Robin Tucker