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
[C#]
public SoapException Exception {get;}
[C++]
public: __property SoapException* get_Exception();
[JScript]
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.

Remarks

The Exception property can be accessed during any SoapMessageStage.

Example

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

[C#] 
if (mySoapMessage.Exception != null)
{
   myStreamWriter.WriteLine("A SoapException occurred!!!"); 
   myStreamWriter.WriteLine(mySoapMessage.Exception.Message);
}   

[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.

Requirements

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

Show: