我为我的项目创建了一个Windows应用程序。我在Windows应用程序中使用外部方的WEB服务。每当我单击一个按钮时,Web服务客户端就会创建按钮单击事件,然后调用特定的Web服务方法。
现在,我一直在调用Web服务的方法时遇到Timeout异常。我已经联系了网络服务提供商,但他们说他们的工作正常。 wsdl文件也完全在所有浏览器中打开,但在应用程序中它没有给出响应。
响应/错误消息System.Net.WebException:
该操作已在WebServiceStudio.WSSWebRequest.GetResponse()
的System.Net.HttpWebRequest.GetResponse()超时
我已经使用Webservice测试客户端,SOAP UI测试了这个Web服务,但我没有得到任何响应。
我尝试通过编写以下代码来增加Windows应用程序中的超时:
// Creating the Client
MoreMoneyBranchListService.Ws_Api_BranchesListSoapPortClient client = new MoreMoneyBranchListService.Ws_Api_BranchesListSoapPortClient();
// Increasing the time out
cl.InnerChannel.OperationTimeout = new TimeSpan(0, 10, 55);
客户端配置:
<client>
<endpoint address="moresistemas.com:5005//aws_api_brancheslist.aspx"
binding="basicHttpBinding"
bindingConfiguration="Ws_Api_BranchesListSoapBinding"
contract="MoreMoneyBranchListService.Ws_Api_BranchesListSoapPort"
name="Ws_Api_BranchesListSoapPort" />
</client>
增加超时后,现在我收到了通信异常。
请帮助!!