【问题标题】:How can I find out if a Web service is running or not?如何确定 Web 服务是否正在运行?
【发布时间】:2010-07-03 05:04:42
【问题描述】:

我想检查网络服务的可用性。 这是我从 Web 服务运行函数的代码

DataSet ds = new DataSet();
DataTable dt = new DataTable();
NegsoNotifier.WorkItemsService.WorkItemsSoapClient wiservice;

wiservice = new NegsoNotifier.WorkItemsService.WorkItemsSoapClient();
System.ServiceModel.EndpointAddress adr;
adr = new System.ServiceModel.EndpointAddress(Weburl);
wiservice.Endpoint.Address = adr;
//wiservice.Open();

ds = wiservice.GetMyWorkItems(Username, Password);
dt = ds.Tables[0];

我如何知道这个 Web 服务是否正在运行?

【问题讨论】:

  • 您的意思是“确定”而不是“理解”吗?你想“找出”它是否正在运行?

标签: c# .net wcf web-services


【解决方案1】:

如果服务应答,那么它正在运行。如果它的回答对问题正确,那么它运行正确。

请注意,它可能正在运行,但运行不正确正确。例如,它需要的数据库服务器可能已关闭。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-07-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多