【问题标题】:WCF service call using TAP pattern does not honor WCF binding timeout使用 TAP 模式的 WCF 服务调用不遵守 WCF 绑定超时
【发布时间】:2014-12-27 02:41:35
【问题描述】:

我正在使用 Xamarin iOS 和 silverlight 3 slsvcutil 来生成 WCF 服务以在移动应用程序中使用。然后我使用 Task.Factory.FromAsync 创建一个基于任务的实现,这样我就可以对服务调用使用异步等待。在进行长时间数据传输的调用时,我在 60 秒时遇到网络超时异常,即使 WCF 绑定设置为使用 10 分钟,长但安全。创建Task的代码是:

public Task<byte[]> SyncExAsyncT(int accountId, string accountUsername, byte[] syncData, System.DateTime lastSyncDateUtc, int appVersion, string deviceName, string misc, int modelVersion, string deviceToken)
{
    return Task<byte[]>.Factory.FromAsync((callback, asyncState) =>
        base.Channel.BeginSyncEx(accountId, accountUsername, syncData, lastSyncDateUtc, appVersion, deviceName, misc, modelVersion, deviceToken, callback, asyncState),
        base.Channel.EndSyncEx, null);
}

我使用byte[] responseStream = await client.SyncExAsyncT按预期调用方法

如何控制此实现的超时,以避免网络超时 60 秒?

【问题讨论】:

  • 您确定超时来自 WCF 而不是底层数据连接?

标签: web-services wcf timeout async-await


【解决方案1】:

另请参阅这些错误:

https://bugzilla.xamarin.com/show_bug.cgi?id=25251
https://bugzilla.xamarin.com/show_bug.cgi?id=19697
https://bugzilla.xamarin.com/show_bug.cgi?id=18029

这个问题几个月以来一直没有解决

【讨论】:

    猜你喜欢
    • 2018-03-30
    • 1970-01-01
    • 2013-03-24
    • 1970-01-01
    • 2014-03-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-03-23
    相关资源
    最近更新 更多