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 / August 2005

Tip: Looking for answers? Try searching our database.

debug session on a webservice does not end

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
mekim - 06 Nov 2004 14:07 GMT
Hi All,

I have a solution that has a asp.net app project and webservice project in it

When I debug the asp.net app...and then terminate it...the webservice is
still live...and aspnet_wp.exe is still live w/ it.  I have to end task
aspnet_wp.exe in order for the webservice part of the solution to end

Is there a "right" way to terminate a webservice project when it is called
from a asp.net project in a solution?

Regards,
Mekim
Martin Kulov - 08 Nov 2004 09:46 GMT
Hi Mekim,

Your web service request ends as long as your method finishes its execution. The aspnet_wp.exe keeps running because it is part of IIS. As such IIS keeps it running to handle subsequent requests without having to ‘warm up’ the service on every request. What do you mean by ‘the webservice part of the solution to end’? Which part is not ended when your method finishes?
You can use iisreset.exe to restart IIS.

Regards,
Martin Kulov
www.codeattest.com
mekim - 08 Nov 2004 12:28 GMT
Hi Martin...thx for your response

In the the webservice portion of the solution...the global.asax is still
live ...even though the "start up project" 's debug session has been
terminated.

And...the only way to terminate that is to terminate the apnet_wp.exe :-/

Regard,
Mekim

> Hi Mekim,
>
[quoted text clipped - 4 lines]
> Martin Kulov
> www.codeattest.com
Martin Kulov - 08 Nov 2004 21:45 GMT
Hi mekim,

That's the idea of global.asax file. What do you trying to achieve? Generally speaking it is not recommended practice to write custom code in global.asax file.

Martin
mekim - 08 Nov 2004 23:04 GMT
Hi Martin,

In the webservice's global.asax file I create an object (private myClass1 as
new classWhatever) on app_start to persist data between calls.

The problem is that the object is not destroyed in app_end since it's not
called when I terminate the main project during debug.  hmmm...come to think
of it...I'm not sure how app_end is ever called in a webservice project

Regards,
Mekim

> Hi mekim,
>
> That's the idea of global.asax file. What do you trying to achieve? Generally speaking it is not recommended practice to write custom code in global.asax file.
>
> Martin
Martin Kulov - 09 Nov 2004 09:20 GMT
Hi mekim,

App_end is never called because the debugger gets detached from the aspnet_wp.exe process when you stop debugging. When detaching, it does not end the execution of the process. The process will end after some timeout elapse. You can add trace statements to see when this happen.
IMHO it is better to avoid adding code to global.asax file in order to manage state. Why do not you use Session, of better yet – Cache class which can store your session state?

Martin
mekim - 09 Nov 2004 11:18 GMT
Hi Martin,

well...that's silly...if I'm ending the debug session...it's good-bye app
time...but I guess not...:/

A/w...in ref to your session pt...I'll tell u why i didn't use session...and
p/ correct me

1-session adds overhead to each webservice call
2-what's wrong  w/ using global.asax?

Regards,
Mekim

> Hi mekim,
>
> App_end is never called because the debugger gets detached from the aspnet_wp.exe process when you stop debugging. When detaching, it does not end the execution of the process. The process will end after some timeout elapse. You can add trace statements to see when this happen.
> IMHO it is better to avoid adding code to global.asax file in order to manage state. Why do not you use Session, of better yet – Cache class which can store your session state?
>
> Martin
Martin Kulov - 10 Nov 2004 09:15 GMT
Hi mekim,

>> 1-session adds overhead to each webservice call
The problem with session was that is could not scale well. However in current ASP.NET version there are ways to store session state in database. It won't add any other overhead more than your class adds in global.asax

>> 2-what's wrong w/ using global.asax?
Nothing. I consider it bad practice since the code is placed in a location that does not belong to any page. Since web request are considered stateless and every page is alone for itself I prefer writing code in into each page source file. I makes finding the problems easier. From the ages of ASP 3.0 modifing the global.asa file causes the web server to restart the application and may be I am used not to touch global.asa? files also.

Regards,

Martin Kulov
www.codeattest.com
torkish - 02 Aug 2005 12:58 GMT
i just want to confirm that i need the aspnet_wp.exe to end after the
webservice because i'm writing to a text file in the webservice method,
so if the process of the aspnet_wp.exe doesnt end, the output file is
still in use... so how can i overcome this issue?

--
torkish


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.