Anthony2000
asked on
WCF service connectionstate does not change if the service provider exits.
I have an application that exposes several WCF service sessions. I have a client that consumes these services. If the server is shutdown, the client's session state is still reporting "opened". My current solution is to ping the server (by calling an exposed method in the service) and this seems to work.
My question: Is there some functionality already built into WCF where the client can be alerted if the service has been shutdown? or abnormally terminated? without having to call a method in the service to detect that it is gone? I tried testing the ConnectionState property, but it does not change (it continues to report opened). I am using wsHttpBinding.
Can someone shed some light? Do I need to enable some kind of feature?
Thanks in advance!
My question: Is there some functionality already built into WCF where the client can be alerted if the service has been shutdown? or abnormally terminated? without having to call a method in the service to detect that it is gone? I tried testing the ConnectionState property, but it does not change (it continues to report opened). I am using wsHttpBinding.
Can someone shed some light? Do I need to enable some kind of feature?
Thanks in advance!
Hi,
As you are using wsHTTP could you setup some sort of call back error handling.
Here are a few links:
http://stackoverflow.com/questions/1700917/how-does-a-wcf-server-inform-a-wcf-client-about-changes-better-solution-then-si
http://msdn.microsoft.com/en-us/library/system.servicemodel.dispatcher.iinstanceprovider.aspx
http://weblogs.asp.net/pglavich/archive/2008/10/16/wcf-ierrorhandler-and-propagating-faults.aspx also look at long polling as mentioned in this post.
Cheers,
Darren
As you are using wsHTTP could you setup some sort of call back error handling.
Here are a few links:
http://stackoverflow.com/questions/1700917/how-does-a-wcf-server-inform-a-wcf-client-about-changes-better-solution-then-si
http://msdn.microsoft.com/en-us/library/system.servicemodel.dispatcher.iinstanceprovider.aspx
http://weblogs.asp.net/pglavich/archive/2008/10/16/wcf-ierrorhandler-and-propagating-faults.aspx also look at long polling as mentioned in this post.
Cheers,
Darren
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Since my solution is working, I am going to close this question. Anyone reading this will have to decide if they would like to research another solution. Maybe future releases of WCF will update the state of the connection at the time that the connection is broken.
ASKER
the classes that are exposed are decorated with:
<ServiceBehavior(InstanceC
and I am using "wsHttpBinding" as the service binding
Thanks!