Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / April 2006

Tip: Looking for answers? Try searching our database.

Session State

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Victor Paraschiv - 10 Apr 2006 09:14 GMT
I have created a  simple webservice using C#. Now I want to consume it
from a windows application.The problem is that the information saved in
Session object do not persist across calls of different methods from the
same instance of application.All of them have the
[WebMethod(EnabledSession = true)] specified. Any hints? Am I missing
something?
Robert May - 10 Apr 2006 18:37 GMT
Victor,

Web service calls are just like web page calls and are inheritly stateless
in nature.  If you're connecting with a thick client, you should look at
saving your state there and NOT persisting it on the web server itself.
Using sessions, in general, will reduce scaleability and also cause problems
for the users when their sessions timeout.  For example, what happens when
the user is in a multi-step process and walks away from their machine for 30
minutes, causing the session to timeout?

I would suggest that you look into an alternative method other than storing
session state information and trying to persist data over multiple calls to
the web service.  Sending xml strings with the data that you need is a great
way to send in large amounts of information.

Since I tend to follow that practice and have never used sessions with web
services, I can't give you much advice on actually using sessions with
WebServices. :)

Good Luck,

Robert

>I have created a  simple webservice using C#. Now I want to consume it from
>a windows application.The problem is that the information saved in Session
>object do not persist across calls of different methods from the same
>instance of application.All of them have the [WebMethod(EnabledSession =
>true)] specified. Any hints? Am I missing something?
vincent - 10 Apr 2006 20:20 GMT
Hello,

I agree WebServices should be stateless.
But sometimes, for example when you need to store a security context for
an user, you can't do it on client side.
I know you can use Sessions with some tricks like using a CookieContainer
on client side...

Good luck

> Victor,
>
[quoted text clipped - 26 lines]
>> [WebMethod(EnabledSession = true)] specified. Any hints? Am I missing
>> something?
Victor Paraschiv - 11 Apr 2006 14:02 GMT
Thanks for your answers and advices.I think I'll try to figure out how
to deal with a webservice without using Sessions.

> Hello,
>
[quoted text clipped - 36 lines]
>>> [WebMethod(EnabledSession = true)] specified. Any hints? Am I missing
>>> something?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.