Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / March 2005

Tip: Looking for answers? Try searching our database.

SoapService class instance "cached" between SOAP calls

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
SA - 14 Mar 2005 21:45 GMT
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)?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.