-----------------------------------------------------------

New Message on BDOTNET

-----------------------------------------------------------
From: VBGURU
Message 7 in Discussion

www.aravinda.in www.code.aravinda.in www.fun.aravinda.in  www.kedge.aravinda.in 
www.live.aravinda.in www.search.aravinda.in      just checking have u used, 
WebMethodAttribute.EnableSession Property      Property Valuetrue if session 
state is enabled for an XML Web service method. The default is false.    
type=text/Javascript> var ExpCollDivStr = ExpCollDivStr; ExpCollDivStr = 
ExpCollDivStr + "ctl00_LibFrame_ctl10194d871,"; var ExpCollImgStr = 
ExpCollImgStr;  ExpCollImgStr = ExpCollImgStr + "ctl00_LibFrame_ctl10img,"; 
</SCRIPT> Remarks
   
In order to store session state in the ASP.NET HttpSessionState object, the XML 
Web service must inherit from WebService and a WebMethodAttribute applied to 
the XML Web service method, setting the EnableSession property to true. If 
session state is not needed for an XML Web service method, then disabling it 
may improve performance. 
An XML Web service client is uniquely identified by an HTTP cookie returned by 
an XML Web service. In order for an XML Web service to maintain session state 
for a client, the client must persist the cookie. Clients can receive the HTTP 
cookie by creating a new instance of CookieContainer and assigning that to the 
CookieContainer property of the proxy class before calling the XML Web service 
method. If you need to maintain session state beyond when the proxy class 
instance goes out of scope, the client must persist the HTTP cookie between 
calls to the XML Web service. For instance, a Web Forms client can persist the 
HTTP cookie by saving the CookieContainer in its own session state. Because not 
all XML Web services use session state and thus clients are not always required 
to use the CookieContainer property of a client proxy, the documentation for 
the XML Web service should state whether session state is used.   
type=text/Javascript> var ExpCollDivStr = ExpCollDivStr; ExpCollDivStr = 
ExpCollDivStr + "ctl00_LibFrame_ctl17eefb9b0,"; var ExpCollImgStr = 
ExpCollImgStr;  ExpCollImgStr = ExpCollImgStr + "ctl00_LibFrame_ctl17img,"; 
</SCRIPT> Example
   
The example below uses session state to determine how many times a particular 
session accesses the XML Web service method SessionHitCounter 
  
  
<%@ 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"]);
    }   
 }
 
-aravinda 
  
www.aravinda.in www.code.aravinda.in www.fun.aravinda.in  www.kedge.aravinda.in 
www.live.aravinda.in www.search.aravinda.in 

-----------------------------------------------------------

To stop getting this e-mail, or change how often it arrives, go to your E-mail 
Settings.
http://groups.msn.com/BDotNet/_emailsettings.msnw

Need help? If you've forgotten your password, please go to Passport Member 
Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help

For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact

If you do not want to receive future e-mail from this MSN group, or if you 
received this message by mistake, please click the "Remove" link below. On the 
pre-addressed e-mail message that opens, simply click "Send". Your e-mail 
address will be deleted from this group's mailing list.
mailto:[EMAIL PROTECTED]

Reply via email to