比如1、经常出现调用wcf服务超时(不知道这个是属于什么类型的异常),我想做的是抛出一个自定义异常,然后导航到登录界面重新登录。
2、连接断开,会自动重新连接。

解决方案 »

  1.   

    你的意思是服务端怎么给调用端抛出自定义异常吧?
    在操作契约上标注FaultContract就可以了:
     [ServiceContract]
     public interface IWCFService
     {
         [OperationContract]
         [FaultContract(typeof(OverflowException))]//里面可以是自定义异常类型
          string SayHello(string name);
     }