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 / September 2007

Tip: Looking for answers? Try searching our database.

Question

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Redivivus - 23 Sep 2007 16:50 GMT
Hi

Another question about Sessions in webservices

I have read, that usin Sessions in a webservice is a bad design?
Lets explain my scenario;

1) Client is a .NET WinForms application(for public libraries)
2) Server - ASP.NET WebServices, SQL

a) Client logs into library -  here i must store library ID and other
ID's(patron id aso.) for future use.
   When using Sessions is bad idea how and where to store library ID?
When i store it on client side, i must use it in every method when i call a
webservice!
For example i have method GetAllLoans()
When libray ID is stored serve side, i can only call GetAllLoans() and i get
back dataset.
When library ID is stored on client side, i muse call GetAllLoans(libID)

Also, i think, when ID is stored server side, its much easyer to build other
business logic and queryes
where those ID's are needed!?

Hope you understand me :)

Best regards;

Mex
John Saunders [MVP] - 24 Sep 2007 21:31 GMT
> Hi
>
[quoted text clipped - 15 lines]
> get back dataset.
> When library ID is stored on client side, i muse call GetAllLoans(libID)

Soap Headers are useful for this sort of thing. The client won't have to
physically send the ids on every request; .NET will do it for the client.
Similarly, the server won't have to do anything to access the data in the
headers. It will just sort of "be there".

It's best if a web service is kept stateless.  That way, it scales better,
and you don't have to depend on the hosting environment maintaining state
for you (or not).
Signature

--------------------------------------------------------------------------------
John Saunders | MVP - Windows Server System - Connected System Developer

Spam Catcher - 25 Sep 2007 16:34 GMT
> Also, i think, when ID is stored server side, its much easyer to build
> other business logic and queryes
> where those ID's are needed!?

If you need a stateful service, consider using WCF? WCF has session support
built in.

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.