FirstClass members:
- static int counter;
- SingletonClass sc = SingletonClass.Instance;
Moreovere FirstClass uses a static class named SecondClass with a static
property SecondClass.Description.
In a normal windows application:
- if in the Main method I create 2 or more instances of FirstClass, they all
see the same counter, the same SingletonClass.Instance and the same
SecondClass.Description
- if I launch the exe 2 or more times each exe sees different things
What does it happen with web services???
I think a web service is like a web page, so it lives only for the duration
of the execution of a webmethod like an exe lives only until we click on the
x: each call should reset counter to 0 so but this is not true!
Why???
Logging on a text file I have discovered that two sequential calls to the
same web method refers to the same SingletonClass.Instance so I've thought
that I can declare a static DateTime and execute a method only if last call
was 24 hours ago.
To my surprise that DateTime is reset on each subsequent call but not if two
calls are simultaneous.
I do not understand what is the exact behaviour of Web Services: subsequent
calls are like 2 launch of the same exe and simultaneous ones like 2
creation of FirstClass from the Main method?
Thanks,
Luigi.