A service can be checked whether it is running or not by accessing its metadata. If it doesn’t throw exception, means, its running and up.
ASP.NET and C# Sample Code:
MetadataExchangeClient client;
bool isServiceUp = true;
try
{
client = new MetadataExchangeClient(new Uri(“<Service address>”), MetadataExchangeClientMode.HttpGet);
MetadataSet metadata = client.GetMetadata();
}
catch (Exception ex)
{
isServiceUp = false;
}
Metadata contains a reference that cannot be resolved:
ReplyDelete