1.) I have a main method Processing, which takes string as an arguments and that string contains some x number of tasks.
2.) I have another method Status, which keep
PerSession will not make your static variables not shared across object instances. The only thing that PerSession context mode does is controlling of object lifetime.
With PerSession WCF does not destroy service object until session is over. Session can be closed explicitly by client or by timeout (default is 10 min). Every next call from client with the same session Id will be routed by WCF to existing object.
Variables should be not static to prevent sharing across different service instances. State of variables will be maintened by WCF as long as you use InstanceContextMode.PerSession and binding that maintain session.
public int TotalTests = 0;
public int CurrentTest = 0;
I would also add SessionMode.Required to contract to make sure that service is properly configured.
[ServiceContract(SessionMode = SessionMode.Required )]