2012-06-29 4 views
0

비누 예외를 올바르게 잡는 방법을 알려드립니다. 나는 system.net.webexception (Error 500 HTTP)로만 잡을 수 있지만 soapheaderexception이나 soap 예외는 아니다.Catch SOAP Exception .NET

내 현재 코드는 다음과 같습니다 당신의 답변에 대한

Try 
     'Code 

Catch soapExcpHeader As System.Web.Services.Protocols.SoapHeaderException 
      'Can't catch here 
      Dim error_desc As String = soapExcpHeader.Detail.OuterXml 
      Throw New System.Web.Services.Protocols.SoapHeaderException() 
Catch soapExcp As System.Web.Services.Protocols.SoapException 
      'Can't catch here 
      Dim error_desc As String = soapExcp.Detail.OuterXml 
      Throw New System.Web.Services.Protocols.SoapException 
Catch webExcp As System.Net.WebException 
      'Here I catch 
      Console.WriteLine(webExcp.ToString()) 
      Throw webExcp 
Catch ex as Exception 
      'Other types of exceptions 
      Throw ex 
End Try 

언제나처럼 감사합니다.

답변

0

catch 블록이 System.Web.Services.Protocols.SoapHeaderException에서 중지되지 않으면 예외의 GetType() 속성 값이 무엇인지 확인하십시오. 예외가 예외를 상속하지 않는다는 것을 의미합니다. 그것.

관련 문제