Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > Sessions with web services

Reply
Thread Tools

Sessions with web services

 
 
Joshua Ellul
Guest
Posts: n/a
 
      02-16-2004
Hi There,

Could someone tell me how to implement sessions in web services?

I am using the EnableSession property (set to true)... however, the session
is not being maintained... is there something I am missing? Perhaps setting
a session time out? The client of the web service is an asp.net web form.

Thanks,

Josh


 
Reply With Quote
 
 
 
 
Jan Tielens
Guest
Posts: n/a
 
      02-16-2004
To maintain session state:

WebMethodAttribute.EnableSession Property
Indicates whether session state is enabled for an XML Web service method.
http://tinyurl.com/2rs6d

Did you follow following example (see url also)?
<%@ WebService Language="C#" Class="Util" %>

using System.Web.Services;

public class Util: WebService {
[ WebMethod(Description="Per session Hit Counter",EnableSession=true)]
public int SessionHitCounter() {
if (Session["HitCounter"] == null) {
Session["HitCounter"] = 1;
}
else {
Session["HitCounter"] = ((int) Session["HitCounter"]) + 1;
}
return ((int) Session["HitCounter"]);
}
}


--
Greetz

Jan Tielens
________________________________
Read my weblog: http://weblogs.asp.net/jan


"Joshua Ellul" <> wrote in message
news:...
> Hi There,
>
> Could someone tell me how to implement sessions in web services?
>
> I am using the EnableSession property (set to true)... however, the

session
> is not being maintained... is there something I am missing? Perhaps

setting
> a session time out? The client of the web service is an asp.net web form.
>
> Thanks,
>
> Josh
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Moving from ASP Sessions to Database Sessions Bookham Measures ASP General 19 08-23-2007 03:51 PM
Cookieless Sessions (Sessions Without Cookies) and Security scottymo ASP .Net Security 3 09-29-2006 11:00 PM
How .NET web services client handles exceptions from Java web services? John ASP .Net Web Services 4 03-31-2006 10:13 PM
Multi-tiered services (keeping sessions straight) Thor Johnson ASP .Net Web Services 0 10-08-2003 04:20 PM
Re: Relationship between IIS Sessions and ASP.NET Sessions? Ken Cox [Microsoft MVP] ASP .Net 1 08-08-2003 03:22 PM



Advertisments