0
這就是我需要做的:異常和TDetail
catch (System.ServiceModel.FaultException<CustomFault> ex)
{
throw ex;
}
的問題是,我發現了故障
System.ServiceModel.Security.MessageSecurityException
如何退還自定義的錯嗎?
這就是我需要做的:異常和TDetail
catch (System.ServiceModel.FaultException<CustomFault> ex)
{
throw ex;
}
的問題是,我發現了故障
System.ServiceModel.Security.MessageSecurityException
如何退還自定義的錯嗎?
你想趕上服務器端故障嗎?這不會奏效;在執行服務器代碼之前拋出MessageSecurityException
。
如果你想趕上客戶端代碼故障,只需使用
catch (System.ServiceModel.Security.MessageSecurityException ex)
{
// handle exception
}
自定義故障返回是不屬於例外(例如)的信息。我如何獲得這些數據? – divided
@divided:我需要更多的上下文才能回答。如果故障實際上並不是生成異常的東西,那麼你*無法*獲取所需的信息。如果你得到'MessageSecurityException'客戶端,賠率是你的綁定是錯誤的。 – Randolpho
@Randolpho - 我得到錯誤客戶端。 – divided