我有一个 WCF 带有 Silverlight 客户端和 的双工服务.NET 3.5 WCF 服务。
我遇到的情况是:在从服务器到客户端的双工推送 OneWay 操作期间,如果客户端通知处理程序中发生异常,则 channel 会静默出现故障,因此来自服务器的任何进一步双工调用都会超时并失败。 (如此处所述 One-Way Operations and Exceptions )
我的问题:
FaultContract
装饰吗? OneWay OperationContract
, 在客户端包装异常并防止 channel 故障? 最佳答案
当您使用 OneWay
OperationContract
,接收者不应回复,请求的发送者也不应期待回复。
- You can't.
- Your best bet is you can create another
OneWay
OperationContract
between client and the service so that the service can send the fault to the client.
关于silverlight - WCF:OneWay OperationContract 上的异常处理,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4913345/