0
我想如何正確地捕捉肥皂異常。我只能將它作爲system.net.webexception(Error 500 HTTP)捕獲,但不能作爲soapheaderexception或soap異常捕獲。捕捉SOAP異常.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
一如既往感謝您的答覆。