Nicolas2608

Hi everybody,

In my learning of WCF i have again a question.
I want to make an "monitoring" of my application server (services hosted).
By monitoring i want to say it's just a method into a service that can connect to each service hosted on this instance. So i just want to browse all my service running.

Eg ( this a very bad approch i know but i think this is the best eg that can i explain :
public void BrowsServices()
{
foreach ( host h in HostedList)
foreach ( Service s in ServicesList )
s.IsRunning
}


Is it possible to make this and if yes how can i do

Thanks for your help,


Nicolas



Re: Windows Communication Foundation (Indigo) Browsing Service Hosted

Mohammad Makarechian - MSFT

Hello,

If I could make a suggestion, you can use the following approach, if it fits your requirements/constraints.

After each service successfully starts up, you can communicate its base address to the monitoring application, or store it in a central place such as a database (which the monitoring application could also access). The monitoring application could then take each address and "ping" it by calling one of the endpoints. It won't matter which endpoint, as long as the endpoint responds; you could have a special ping endpoint or simply call any endpoint (which would obviously have to be a request-reply operation contract, so you could check to make sure the reply is received) and ignore the response -- it's only important that you get a response.

Would this work for you

Thanks.





Re: Windows Communication Foundation (Indigo) Browsing Service Hosted

Nicolas2608

Hello,

Thanks a lot for your reply.

It's a great idee and i have already tought about ping call. So a method called Ping and then return pong.
But in my idee, a database wasn't the solution.
Because i want to make a aspx web page that can easy call method without many information about host. But if this the soltuion i just place a database.

The second reflexion is about WMI. But i don't know how to implement WMI and if it's possible

Thanks







Re: Windows Communication Foundation (Indigo) Browsing Service Hosted

Mohammad Makarechian - MSFT

If database is not a good option for you, then each service could "register" itself with the monitoring application after it successfully starts up. In fact, the monitoring application itself could be a WCF service with endpoints that the services could register or de-register themselves with. You could even implement a pub-sub pattern, although that may be an overkill in your case.

In any case, even in the case of WMI, you'll need a well-known address, be it the database location, the URL of the monitoring application or the WMI service. By the way, WMI is a solution. You should be able find more information about it on MSDN.

Thanks.





Re: Windows Communication Foundation (Indigo) Browsing Service Hosted

Nicolas2608

Okay i'm going to try to implement the solution with database.
Or perhaps try to plug in a dll that can put the service into a singleton.


Thanks for your help.

Best regards,