473,721 Members | 2,074 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

restart webservice

hi guru's
I want to restart my webservice when ever it throws an exception that isn't
cought. can i do that by web.config or iss or how ??
Nov 23 '05 #1
8 9319
What exactly do you mean when you say restart? You always get a new
instance of your web service class for every new incoming request. Why
do you want to restart the service?

You would have to restart the ASP.Net or the IIS worker process which
would affect the availability of your web service and potentially other
web applications on that serve.

Also you would need to run undo an account with administrator
privileges. Is that really something you want to do?

HTH,
Christoph Schittko
MVP XML
http://weblogs.asp.net/cschittko
-----Original Message-----
From: kenneth fleckenstein nielsen
[mailto:ke****** *************** ***@discussions .microsoft.com]
Posted At: Monday, December 27, 2004 4:14 AM
Posted To: microsoft.publi c.dotnet.framew ork.webservices
Conversation: restart webservice
Subject: restart webservice

hi guru's
I want to restart my webservice when ever it throws an exception that
isn't
cought. can i do that by web.config or iss or how ??


Nov 23 '05 #2
I want to restart, because that is my best guess, When i get an exception
thrown it is from the db I'm connecting to and I think i should kill the db
connection, because the db ties up licenses. When it happens during debug I
kill the aspnet_wp.exe process and all the licenses are released.

"Christoph Schittko [MVP]" wrote:
What exactly do you mean when you say restart? You always get a new
instance of your web service class for every new incoming request. Why
do you want to restart the service?

You would have to restart the ASP.Net or the IIS worker process which
would affect the availability of your web service and potentially other
web applications on that serve.

Also you would need to run undo an account with administrator
privileges. Is that really something you want to do?

HTH,
Christoph Schittko
MVP XML
http://weblogs.asp.net/cschittko
-----Original Message-----
From: kenneth fleckenstein nielsen
[mailto:ke****** *************** ***@discussions .microsoft.com]
Posted At: Monday, December 27, 2004 4:14 AM
Posted To: microsoft.publi c.dotnet.framew ork.webservices
Conversation: restart webservice
Subject: restart webservice

hi guru's
I want to restart my webservice when ever it throws an exception that
isn't
cought. can i do that by web.config or iss or how ??


Nov 23 '05 #3
I've just been looking around the user on my computer, ASPNET is appearently
only used for running the aspnet_wp process, and i could set appearently set
som times to shorter than ever on my iss's properties.
Which i guess will end the session and close the application and retarting
it again. ( and herby freeing licenses)

"Christoph Schittko [MVP]" wrote:
What exactly do you mean when you say restart? You always get a new
instance of your web service class for every new incoming request. Why
do you want to restart the service?

You would have to restart the ASP.Net or the IIS worker process which
would affect the availability of your web service and potentially other
web applications on that serve.

Also you would need to run undo an account with administrator
privileges. Is that really something you want to do?

HTH,
Christoph Schittko
MVP XML
http://weblogs.asp.net/cschittko
-----Original Message-----
From: kenneth fleckenstein nielsen
[mailto:ke****** *************** ***@discussions .microsoft.com]
Posted At: Monday, December 27, 2004 4:14 AM
Posted To: microsoft.publi c.dotnet.framew ork.webservices
Conversation: restart webservice
Subject: restart webservice

hi guru's
I want to restart my webservice when ever it throws an exception that
isn't
cought. can i do that by web.config or iss or how ??


Nov 23 '05 #4
It sounds like you are storing database connections (or objects that
hold open database connections) in the session state? If that's the case
you need to design your application to eliminate the root cause of your
problems instead of addressing the symptom by killing the worker
process.

You __have to__ follow the recommended usage for database connections,
i.e. call open as late as possible, execute your SQL and close/dispose
the connection. Otherwise you will see the problems you're reporting.

Killing the worker process will kill all sessions for all web
applications running in that instance. You can never be sure that you
are not impacting other users of other applications when you just kill
the process.

HTH,
Christoph Schittko
MVP XML
http://weblogs.asp.net/cschittko

-----Original Message-----
From: kenneth fleckenstein nielsen
[mailto:ke****** *************** ***@discussions .microsoft.com]
Posted At: Tuesday, December 28, 2004 7:35 AM
Posted To: microsoft.publi c.dotnet.framew ork.webservices
Conversation: restart webservice
Subject: Re: restart webservice

I've just been looking around the user on my computer, ASPNET is
appearently
only used for running the aspnet_wp process, and i could set appearently set
som times to shorter than ever on my iss's properties.
Which i guess will end the session and close the application and retarting it again. ( and herby freeing licenses)

"Christoph Schittko [MVP]" wrote:
What exactly do you mean when you say restart? You always get a new
instance of your web service class for every new incoming request. Why do you want to restart the service?

You would have to restart the ASP.Net or the IIS worker process which would affect the availability of your web service and potentially other web applications on that serve.

Also you would need to run undo an account with administrator
privileges. Is that really something you want to do?

HTH,
Christoph Schittko
MVP XML
http://weblogs.asp.net/cschittko
-----Original Message-----
From: kenneth fleckenstein nielsen
[mailto:ke****** *************** ***@discussions .microsoft.com]
Posted At: Monday, December 27, 2004 4:14 AM
Posted To: microsoft.publi c.dotnet.framew ork.webservices
Conversation: restart webservice
Subject: restart webservice

hi guru's
I want to restart my webservice when ever it throws an exception that isn't
cought. can i do that by web.config or iss or how ??



Nov 23 '05 #5
hmm, I developing in c# & .net, and open the session in the 'global' class
generated when you create a new webservice project. I open in thefunction:
protected void Session_Start(O bject sender, EventArgs e)
- you state that i should do it much later ? and that way can control the
licens use better. And catch exceptions thrown by the db better, and wont
have to force the app to restart.

"Christoph Schittko [MVP]" wrote:
It sounds like you are storing database connections (or objects that
hold open database connections) in the session state? If that's the case
you need to design your application to eliminate the root cause of your
problems instead of addressing the symptom by killing the worker
process.

You __have to__ follow the recommended usage for database connections,
i.e. call open as late as possible, execute your SQL and close/dispose
the connection. Otherwise you will see the problems you're reporting.

Killing the worker process will kill all sessions for all web
applications running in that instance. You can never be sure that you
are not impacting other users of other applications when you just kill
the process.

HTH,
Christoph Schittko
MVP XML
http://weblogs.asp.net/cschittko

-----Original Message-----
From: kenneth fleckenstein nielsen
[mailto:ke****** *************** ***@discussions .microsoft.com]
Posted At: Tuesday, December 28, 2004 7:35 AM
Posted To: microsoft.publi c.dotnet.framew ork.webservices
Conversation: restart webservice
Subject: Re: restart webservice

I've just been looking around the user on my computer, ASPNET is
appearently
only used for running the aspnet_wp process, and i could set

appearently
set
som times to shorter than ever on my iss's properties.
Which i guess will end the session and close the application and

retarting
it again. ( and herby freeing licenses)

"Christoph Schittko [MVP]" wrote:
What exactly do you mean when you say restart? You always get a new
instance of your web service class for every new incoming request. Why do you want to restart the service?

You would have to restart the ASP.Net or the IIS worker process which would affect the availability of your web service and potentially other web applications on that serve.

Also you would need to run undo an account with administrator
privileges. Is that really something you want to do?

HTH,
Christoph Schittko
MVP XML
http://weblogs.asp.net/cschittko

> -----Original Message-----
> From: kenneth fleckenstein nielsen
> [mailto:ke****** *************** ***@discussions .microsoft.com]
> Posted At: Monday, December 27, 2004 4:14 AM
> Posted To: microsoft.publi c.dotnet.framew ork.webservices
> Conversation: restart webservice
> Subject: restart webservice
>
> hi guru's
> I want to restart my webservice when ever it throws an exception that > isn't
> cought. can i do that by web.config or iss or how ??


Nov 23 '05 #6
It would be nice just to restart the httpApp that the service derive from.
But it doesn't seam to have an end/exit function to call.

"Christoph Schittko [MVP]" wrote:
It sounds like you are storing database connections (or objects that
hold open database connections) in the session state? If that's the case
you need to design your application to eliminate the root cause of your
problems instead of addressing the symptom by killing the worker
process.

You __have to__ follow the recommended usage for database connections,
i.e. call open as late as possible, execute your SQL and close/dispose
the connection. Otherwise you will see the problems you're reporting.

Killing the worker process will kill all sessions for all web
applications running in that instance. You can never be sure that you
are not impacting other users of other applications when you just kill
the process.

HTH,
Christoph Schittko
MVP XML
http://weblogs.asp.net/cschittko

-----Original Message-----
From: kenneth fleckenstein nielsen
[mailto:ke****** *************** ***@discussions .microsoft.com]
Posted At: Tuesday, December 28, 2004 7:35 AM
Posted To: microsoft.publi c.dotnet.framew ork.webservices
Conversation: restart webservice
Subject: Re: restart webservice

I've just been looking around the user on my computer, ASPNET is
appearently
only used for running the aspnet_wp process, and i could set

appearently
set
som times to shorter than ever on my iss's properties.
Which i guess will end the session and close the application and

retarting
it again. ( and herby freeing licenses)

"Christoph Schittko [MVP]" wrote:
What exactly do you mean when you say restart? You always get a new
instance of your web service class for every new incoming request. Why do you want to restart the service?

You would have to restart the ASP.Net or the IIS worker process which would affect the availability of your web service and potentially other web applications on that serve.

Also you would need to run undo an account with administrator
privileges. Is that really something you want to do?

HTH,
Christoph Schittko
MVP XML
http://weblogs.asp.net/cschittko

> -----Original Message-----
> From: kenneth fleckenstein nielsen
> [mailto:ke****** *************** ***@discussions .microsoft.com]
> Posted At: Monday, December 27, 2004 4:14 AM
> Posted To: microsoft.publi c.dotnet.framew ork.webservices
> Conversation: restart webservice
> Subject: restart webservice
>
> hi guru's
> I want to restart my webservice when ever it throws an exception that > isn't
> cought. can i do that by web.config or iss or how ??


Nov 23 '05 #7
That's not what you asked for initially ...

It's doable, by unloading the app domain that the application is running
in, but I'm not sure if the account that's doing that requires special
privileged.

Either way, you're much better off changing the design of your
application.

HTH,
Christoph Schittko
MVP XML
http://weblogs.asp.net/cschittko
-----Original Message-----
From: kenneth fleckenstein nielsen
[mailto:ke****** *************** ***@discussions .microsoft.com]
Posted At: Wednesday, December 29, 2004 6:37 AM
Posted To: microsoft.publi c.dotnet.framew ork.webservices
Conversation: restart webservice
Subject: Re: restart webservice

It would be nice just to restart the httpApp that the service derive from. But it doesn't seam to have an end/exit function to call.

"Christoph Schittko [MVP]" wrote:
It sounds like you are storing database connections (or objects that
hold open database connections) in the session state? If that's the case you need to design your application to eliminate the root cause of your problems instead of addressing the symptom by killing the worker
process.

You __have to__ follow the recommended usage for database connections, i.e. call open as late as possible, execute your SQL and close/dispose the connection. Otherwise you will see the problems you're reporting.
Killing the worker process will kill all sessions for all web
applications running in that instance. You can never be sure that you are not impacting other users of other applications when you just kill the process.

HTH,
Christoph Schittko
MVP XML
http://weblogs.asp.net/cschittko

-----Original Message-----
From: kenneth fleckenstein nielsen
[mailto:ke****** *************** ***@discussions .microsoft.com]
Posted At: Tuesday, December 28, 2004 7:35 AM
Posted To: microsoft.publi c.dotnet.framew ork.webservices
Conversation: restart webservice
Subject: Re: restart webservice

I've just been looking around the user on my computer, ASPNET is
appearently
only used for running the aspnet_wp process, and i could set

appearently
set
som times to shorter than ever on my iss's properties.
Which i guess will end the session and close the application and

retarting
it again. ( and herby freeing licenses)

"Christoph Schittko [MVP]" wrote:

> What exactly do you mean when you say restart? You always get a new > instance of your web service class for every new incoming
request. Why
> do you want to restart the service?
>
> You would have to restart the ASP.Net or the IIS worker process

which
> would affect the availability of your web service and
potentially other
> web applications on that serve.
>
> Also you would need to run undo an account with administrator
> privileges. Is that really something you want to do?
>
> HTH,
> Christoph Schittko
> MVP XML
> http://weblogs.asp.net/cschittko
>
> > -----Original Message-----
> > From: kenneth fleckenstein nielsen
> > [mailto:ke****** *************** ***@discussions .microsoft.com]
> > Posted At: Monday, December 27, 2004 4:14 AM
> > Posted To: microsoft.publi c.dotnet.framew ork.webservices
> > Conversation: restart webservice
> > Subject: restart webservice
> >
> > hi guru's
> > I want to restart my webservice when ever it throws an
exception that
> > isn't
> > cought. can i do that by web.config or iss or how ??
>
>



Nov 23 '05 #8
You are correct. Open the connection just when you need to execute a
database command and then close it as soon as you're done. That way you
don't tie up database connections (licenses) and ensure that database
connection can be pooled.

That should avoid your exceptions altogether (or at least rule out one
possible cause ;) ).

HTH,
Christoph Schittko
MVP XML
http://weblogs.asp.net/cschittko

-----Original Message-----
From: kenneth fleckenstein nielsen
[mailto:ke****** *************** ***@discussions .microsoft.com]
Posted At: Wednesday, December 29, 2004 2:35 AM
Posted To: microsoft.publi c.dotnet.framew ork.webservices
Conversation: restart webservice
Subject: Re: restart webservice

hmm, I developing in c# & .net, and open the session in the 'global' class generated when you create a new webservice project. I open in thefunction: protected void Session_Start(O bject sender, EventArgs e)
- you state that i should do it much later ? and that way can control the licens use better. And catch exceptions thrown by the db better, and wont have to force the app to restart.

"Christoph Schittko [MVP]" wrote:
It sounds like you are storing database connections (or objects that
hold open database connections) in the session state? If that's the case you need to design your application to eliminate the root cause of your problems instead of addressing the symptom by killing the worker
process.

You __have to__ follow the recommended usage for database connections, i.e. call open as late as possible, execute your SQL and close/dispose the connection. Otherwise you will see the problems you're reporting.
Killing the worker process will kill all sessions for all web
applications running in that instance. You can never be sure that you are not impacting other users of other applications when you just kill the process.

HTH,
Christoph Schittko
MVP XML
http://weblogs.asp.net/cschittko

-----Original Message-----
From: kenneth fleckenstein nielsen
[mailto:ke****** *************** ***@discussions .microsoft.com]
Posted At: Tuesday, December 28, 2004 7:35 AM
Posted To: microsoft.publi c.dotnet.framew ork.webservices
Conversation: restart webservice
Subject: Re: restart webservice

I've just been looking around the user on my computer, ASPNET is
appearently
only used for running the aspnet_wp process, and i could set

appearently
set
som times to shorter than ever on my iss's properties.
Which i guess will end the session and close the application and

retarting
it again. ( and herby freeing licenses)

"Christoph Schittko [MVP]" wrote:

> What exactly do you mean when you say restart? You always get a new > instance of your web service class for every new incoming
request. Why
> do you want to restart the service?
>
> You would have to restart the ASP.Net or the IIS worker process

which
> would affect the availability of your web service and
potentially other
> web applications on that serve.
>
> Also you would need to run undo an account with administrator
> privileges. Is that really something you want to do?
>
> HTH,
> Christoph Schittko
> MVP XML
> http://weblogs.asp.net/cschittko
>
> > -----Original Message-----
> > From: kenneth fleckenstein nielsen
> > [mailto:ke****** *************** ***@discussions .microsoft.com]
> > Posted At: Monday, December 27, 2004 4:14 AM
> > Posted To: microsoft.publi c.dotnet.framew ork.webservices
> > Conversation: restart webservice
> > Subject: restart webservice
> >
> > hi guru's
> > I want to restart my webservice when ever it throws an
exception that
> > isn't
> > cought. can i do that by web.config or iss or how ??
>
>



Nov 23 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
425
by: DraguVaso | last post by:
Hi, I'm new to WebServices, and I'm doing some tests (with a small VB.NET-application) to know the performance-difference between a WebService and the 'normal'-way of getting data (just connecting directly with a SqlDataAdapter to the SQL Server). The WebMethod simply gives a DataSet back, and does exactly the same actions as the normal-Method does. The difference are enormous in my opinion: 1 record:
6
768
by: Davie | last post by:
I want to authorise a user of a web service by using the AuthHeaderValue for some reason I keep getting a null reference exception when I try to run the following code: It seems to work fine on a .NET Framework application, but just not on the .NET CF version. Can anyone suggest anything that might be wrong with the code? (I could post the app and webservice, but i was hoping that you might have noticed something from the supplied...
1
2107
by: Nalaka | last post by:
Hi, I am testing with Visual studio 2005, web projects. Situation: I have one solution with two web projects, created as file system projects. (I am tesing using the built in server, not IIS) First project is a webService. Second consumes the webservices by the first.
3
3213
by: John A Grandy | last post by:
In ASP.NET 1.1 and/or 2.0 ..... Is it possible to configure a web-app so that replacement of an .xml file ( physically located under the virtual dir root ) with a newer version of the file causes a web-app restart ... ? Also, is a stopping and starting a website in IIS the only way to restart a web-app ? (Of course, iisreset stops and starts all web-apps on the web-server ... but
6
3805
by: Leonardo Curros | last post by:
Hello, I would like to know what's the best way to restart one service. I would like to do it from the service itself. Is this possible? I try it with ServiceController.stop() ServiceController.WaitForStatus(ServiceControllerStatus.Stopped) ServiceController.start() but doesn´t works. It seems waitforstatus instruction is the last
7
2924
by: Nalaka | last post by:
Hi, I created a sinple web service that returns a dataSet. Then I created a client program that uses this web service (that returns the Dataset). My question is, how did the client figure out to create a "DataSet" as the return type from the webservice?
5
3795
by: AliR | last post by:
Hi Everyone, I have a Visual C++ MFC program, and I am trying to use a webservice written in C#. When I add the webservice to my project using Add Web Reference the sproxy compiler complains about one of the object wanting to extend MarshalByRefObject object, and I get an error SDL1030. I can use the webservice in a C# project just fine but not the C++. Can anyone help me out with this?
4
7290
by: shorti | last post by:
Can anyone explain in greater (and more comprehensive) detail what the RESTART option does in the ALTER TABLE table ALTER COLUMN statement. This is the description in Info Center: RESTART or RESTART WITH numeric-constant Resets the state of the sequence associated with the identity column. If WITH numeric-constant is not specified, the sequence for the identity column is restarted at the value that was specified, either implicitly or...
0
2678
by: =?Utf-8?B?TWFuaQ==?= | last post by:
Hi All, Problem in deploying my WebService developed using Asp.net WebServices 2005. I have designed simple WebService using Asp.net Webservices 2.0 , The webservice look this , using System; using System.Web; using System.Web.Services; using System.Web.Services.Protocols;
0
9071
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8013
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6675
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5991
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4490
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4758
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3197
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2581
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2135
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.