我在我的Windows Phone 8应用程序中调用Web服务。它工作正常但有时它接收数据我得到此超时异常。(由于网络速度慢或其他一些问题)。所以这时间我的申请没有被处理,它给出了例外情况下的例外情况。
System.ServiceModel.ni.dll中出现“System.TimeoutException”类型的异常,但未在用户代码中处理
我如何处理此异常。不知道该怎么做。
我的C#代码是
bool isAvailable = NetworkInterface.GetIsNetworkAvailable();
if (isAvailable == true)
{
try
{
WhatsupServices.WhatsUpServiceSoapClient ws = new WhatsupServices.WhatsUpServiceSoapClient();
ws.LoginUserJsonCompleted += ws_LoginUserJsonCompleted;
ws.LoginUserJsonAsync(txtloginUserName.Text, pass, "1");
}
catch (Exception ex)
{ }
}
void ws_LoginUserJsonCompleted(object sender, WhatsupServices.LoginUserJsonCompletedEventArgs e)
{
try
{
//webservice responce
string Result = e.Result;
}
}