Solved

WCF service connectionstate does not change if the service provider exits.

Posted on 2010-09-09
7
836 Views
Last Modified: 2012-05-10
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!
0
Comment
Question by:Anthony2000
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
7 Comments
 
LVL 8

Author Comment

by:Anthony2000
ID: 33726339
More information:
the classes that are exposed are decorated with:

<ServiceBehavior(InstanceContextMode:=InstanceContextMode.PerSession, ConcurrencyMode:=ConcurrencyMode.Single)> _
and I am using "wsHttpBinding" as the service binding
Thanks!
0
 
LVL 18

Expert Comment

by:DarrenD
ID: 33733152
0
 
LVL 8

Accepted Solution

by:
Anthony2000 earned 0 total points
ID: 33733851
I chose wsHttpBinding because it appeared to be the most interoperable binding. I cannot add callbacks because they are incompatible with my solution (according to MSDN). I may need to expose these web services to non dot-net applications.
I am currently pinging the server and this works, I was just thinking that it would be great if I could check the status of the underlying tcp connection (I have to check again and make sure that one is open for the entire time the service exists).
Thank you!
0
 
LVL 8

Author Closing Comment

by:Anthony2000
ID: 34118778
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.
0

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question