首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

如何判断WCF地址是否可用

2013-01-01 
怎么判断WCF地址是否可用?在系统中用到wcf比如这样使用:AppWebServiceReference.AppWebServiceClient clie

怎么判断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...

热点排行