This documentation is archived and is not being maintained.

SoapMessage.Exception Property

Gets the SoapException from the call to the XML Web service method.

[Visual Basic]
Public ReadOnly Property Exception As SoapException
public SoapException Exception {get;}
public: __property SoapException* get_Exception();
public function get Exception() : SoapException;

Property Value

The SoapException that occurred in the call to the XML Web service method. A null reference (Nothing in Visual Basic) if no SoapException has occurred during the call to the Web Sevice method.


The Exception property can be accessed during any SoapMessageStage.


[Visual Basic] 
If Not (mySoapMessage.Exception Is Nothing) Then
   myStreamWriter.WriteLine("A SoapException occurred!!!")
End If

if (mySoapMessage.Exception != null)
   myStreamWriter.WriteLine("A SoapException occurred!!!"); 

[C++, JScript] No example is available for C++ or JScript. To view a Visual Basic or C# example, click the Language Filter button Language Filter in the upper-left corner of the page.


Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework

See Also

SoapMessage Class | SoapMessage Members | System.Web.Services.Protocols Namespace | SoapException | SoapHeaderException