简体   繁体   中英

WCF: Exception handling on OneWay OperationContract

I am having a WCF duplex service with Silverlight client and .NET 3.5 WCF service.

The scenario I have is: during the duplex push OneWay operation from server to client if an exception happens in client notification handler the channel gets silently faulted so any further duplex calls from server timeout and fail. (As explained here One-Way Operations and Exceptions )

My question(s):

  1. Can I just decorate with FaultContract a OneWay OperationContract , wrap the exception on client and prevent faulting of the channel?
  2. if not, what would be some other way to catch the exception which occurred on the client during the duplex push from server?

When you use OneWay OperationContract , the receiver should not reply nor the sender of the request should expect one.

  1. You can't.
  2. 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM