Tutorial :How can I keep the session with the webservice at client?



Question:

My clients could invoke the webservice dynamically by reflection. But how to get the cookies about the session with the webservice? I know set the webmethodattribute enablesession is true, but at the client the webservice object which was generated by reflection has not the attribute of cookiecontainer, how to make it to keep the session state?


Solution:1

Use the EnableSessionAttribute on your web service methods, this will make them using (and keeping) a session object, like explained here at MSDN.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »