Hi all,
I have the following behavior from my class that inherits from SoapService.
Upon the first call to the web service, naturally, an instance of my class
is created. However, upon the second call, the previous instance is re-used.
Upon the third call, a new instance is created. Upon the fourth call, the
instance from the third call is used. Upon the fifth call, etc.
This is completely independent of time (not sure if it's independent from
client). In other words, I can wait 1 second between two calls or a few
minutes, that same SoapService instance will be used upon the "even" calls
to the service.
This behavior is not what I expect/want, because within each call, I cache
certain values. These values, however, are not necessarily valid upon the
next call. I do not store anything in a static variable.
It seems to me like this cannot be the intended behavior either, because if
SoapService works like a .NET Remoting client-activated object, it should be
alive for more than 2 calls. Personally, I would expect SoapService to work
like a .NET Remoting SingleCall object?
<architecture>
My class that inherits from SoapService is registered in web.config as an
httpHandler.
That class has a member variable, called "Engine". I need this as a member
because Engine fires events that need to be intercepted by the SoapService.
In other words, I can't create a new, local Engine object in each web
method.
Engine has a member variable "User" that indicates which user has called the
service, for authorization purposes in the Engine's operations. That user
object doesn't get recreated upon even calls to the service, but it does
upon odd calls to the service. So, that means that no new Engine object is
created upon even calls to the service, and that must mean that no new
SoapService object is created.
I actually verified the above by adding tracing to the SoapService
implementation and Engine class.
</architecture>
Can anyone shed any light on this?

Signature
Sven.
Yves Reynhout - 22 Mar 2005 22:55 GMT
> Hi all,
>
[quoted text clipped - 40 lines]
>
> Can anyone shed any light on this?
IHttpHandler.IsReusable returns true instead of false (wild guess)?