客户如何知道的WCF服务正在运行? [英] How can client know is wcf service is running?

查看:193
本文介绍了客户如何知道的WCF服务正在运行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的服务正在运行当前

localhost:17722/Book.svc

如何让我的客户端应用程序知道,如果该服务试图使用它之前运行?

How can my client app know if the service running before trying to consume it?

推荐答案

不检查,看是否有服务器已启动消费它了。消费服务和处理在通话过程中出现的任何错误。

Don't check to see if a server is up before consuming it. Consume the service and handle any errors that occur during the call.

即使您检查服务已启动就可以下井时间之间你检查它是否和您拨打的服务。所以,即使你检查它是否正在运行,你还需要处理它是下来的时候,你吃了。

Even if you check that the service is up it can go down between the time you check that it is up and you call the service. So even if you check that it is up, you still need to handle it being down when you consume it.

最好的方式来检查,如果一个服务是涨是尝试使用它。

The best way to check if a service is up is to try to use it.

这篇关于客户如何知道的WCF服务正在运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆