Exception Property

SoapMessage.Exception Property

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

Namespace:  System.Web.Services.Protocols
Assembly:  System.Web.Services (in System.Web.Services.dll)

public SoapException Exception { get; set; }

Property Value

Type: System.Web.Services.Protocols.SoapException
The SoapException that occurred in the call to the XML Web service method. null if no SoapException has occurred during the call to the Web Sevice method.

The Exception property can be accessed during any SoapMessageStage.

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

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
© 2015 Microsoft