当前位置: 代码迷 >> ASP.NET >> 如何判断WCF地址是否可用
  详细解决方案

如何判断WCF地址是否可用

热度:1319   发布时间:2013-02-25 00:00:00.0
怎么判断WCF地址是否可用?
在系统中用到wcf
比如这样使用:

AppWebServiceReference.AppWebServiceClient client = new AppWebServiceReference.AppWebServiceClient();
//地址今后由数据库获取
client.Endpoint.Address = new EndpointAddress("http://localhost:5002/AppWebService.svc");
            BasicHttpBinding binding = (BasicHttpBinding)client.Endpoint.Binding;

这样的地址http://localhost:5002/AppWebService.svc,我要怎么判断是否可用
直接把这几行代码 try  catch?
------解决方案--------------------------------------------------------
对就是try...catch...
  相关解决方案