Ask a Question related to ASP.NET Web Services, Design and Development.
-
cmrchs@yahoo.com #1
session state ???
Hi,
I have following function in a WebService-class :
[WebMethod(EnableSession=true)]
public int Count()
{
if ( null == Session["mycounter"] )
Session["mycounter"] = 0;
else
m_counter = (int)Session["mycounter"];
Session["mycounter"] = ++m_counter;
return m_counter;
}
'm_counter' is a datamember of the class.
When calling the WS-function from IExplorer several times do I get an incremented count as return value : OK
.... but invoking the same WS-function from a ConsoleApp always returns me the same value of 1 ???
result = calc.Count();
result = calc.Count();
Console.WriteLine("Count : {0}", result);
how come ?
thnx
Chris
************************************************** ********************
Sent via Fuzzy Software @ [url]http://www.fuzzysoftware.com/[/url]
Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...
cmrchs@yahoo.com Guest
-
Session state IIS (Machine Key | Load Balanced Session)
This is a classic ASP group. Try microsoft.public.dotnet.framework.aspnet "Fred" <me@me.com> wrote in message... -
Session State
Hi, I understand that there are 3 modes in which I can configure the SessionStateModule. What I need is an out of process Session State store... -
Using a SQL DB for session state.
I have encountered a problem when I restart a SQL server I lose my session variables for ASP.NET It seems that the Temp table cannot be used... -
Asp Session state ??
I'm pretty new to asp. It seems that I am assigning to the session rather than comparing against. I want to compare it in the first peice of code... -
Session state...
Why are you calling a webservice that is within the same app. Shouldn't the web service be on a different server or at least be a different IIS... -
BrunoX #2
RE: session state ???
Use a CookieContainer:
System.Net.CookieContainer cookieContainer1 = new
System.Net.CookieContainer();
MyWebService.Calc calc = new MyWebService.Calc();
calc.CookieContainer = cookieContainer1;
result = calc.Count();
result = calc.Count();
Console.WriteLine("Count : {0}", result);
"Chris C" wrote:
> Hi,
>
> I have following function in a WebService-class :
>
> [WebMethod(EnableSession=true)]
> public int Count()
> {
> if ( null == Session["mycounter"] )
> Session["mycounter"] = 0;
> else
> m_counter = (int)Session["mycounter"];
> Session["mycounter"] = ++m_counter;
> return m_counter;
> }
> 'm_counter' is a datamember of the class.
>
> When calling the WS-function from IExplorer several times do I get an incremented count as return value : OK
>
> .... but invoking the same WS-function from a ConsoleApp always returns me the same value of 1 ???
>
> result = calc.Count();
> result = calc.Count();
> Console.WriteLine("Count : {0}", result);
>
> how come ?
> thnx
> Chris
>
> ************************************************** ********************
> Sent via Fuzzy Software @ [url]http://www.fuzzysoftware.com/[/url]
> Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...
>BrunoX Guest



Reply With Quote

