Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8035019
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T02:11:24+00:00 2026-06-05T02:11:24+00:00

I want to know whether the WCF service is available or not before making

  • 0

I want to know whether the WCF service is available or not before making a service call.
What could be the best way?

How about using this:

bool isServiceUp = true;
try
{
   string address = "http://localhost/MyService.svc?wsdl";

 MetadataExchangeClient mexClient = new MetadataExchangeClient(new Uri(address), MetadataExchangeClientMode.HttpGet);
   MetadataSet metadata = mexClient.GetMetadata();
// if service down I get the exception
}
   catch (Exception ex)
{
    isServiceUp = false;
} 

My service is using net tcp binding.

can i use it for net tcp binding?

EDIT: Thanks JaredPar. Suppose my first call gets succeeded and while second call the server is down. So before making the service call i check the state of the proxy which is in the OPEN state and hence i make the service call which eventually gets time out. I haven’t set any open or close time out so by default it takes 1 minute and the call gets caught in the Fault event handler of the service in which i dispose the proxy. But by that time UI hangs , what shd i do?

Please guide.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T02:11:26+00:00Added an answer on June 5, 2026 at 2:11 am

    This type of test is simply not possible. There is no way to reliably detect if a given WCF, or really any networking call, will succeed before you attempt it. There are simply too many variables which are outside your control.

    • The physical network
    • The power source on the machine where WCF is running
    • The actual WCF program
    • The stability of the hard drive on the computer where your code or the WCF code is running

    Any of these can be terminated / changed at any point in time. Hence it’s impossible to predict whether or not a given call will succeed.

    The best way to approach this problem is simply make the call add the code to handle the cases where it does fail.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to know whether unhandled exception will make WCF service crash. I have
i want to know whether there exists an alternative for pyhook(available for windows not
I want to know whether Metro Applications developed using Visual Studio 11 Developer Preview
Using Python, I want to know whether Java is installed.
I want to know whether or not a directory exists. If not, I would
Im creating an application and i want to know whether or not the browser
I want to know whether shift is a higher order function or not. chartoInt
My application want to know whether Data has been enabled or not. That is
I want to know whether there is a way to change the alignment of
I want to know Whether OPENXML SDK provide support for linux platform or not?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.