SoapException.Code Property
Gets the type of SOAP fault code.
[Visual Basic] Public ReadOnly Property Code As XmlQualifiedName [C#] public XmlQualifiedName Code {get;} [C++] public: __property XmlQualifiedName* get_Code(); [JScript] public function get Code() : XmlQualifiedName;
Property Value
An XmlQualifiedName that specifies the SOAP fault code that occurred.
Remarks
The Code property can only be set when creating a new instance of the SoapException class.
The SoapException class is for use by XML Web service clients calling XML Web service methods over SOAP. When an exception occurs in an XML Web service, ASP.NET handles whether the client is calling using SOAP or not. If the client is, ASP.NET wraps the specific exception into a SoapException and sets the Actor and Code properties.
The set of available codes, known as SOAP Fault Codes for SOAP protocol version 1.1 are the following:
| Item | Description |
|---|---|
| VersionMismatchFaultCode | An invalid namespace for a SOAP envelope was found. |
| MustUnderstandFaultCode | Not all SOAP elements require processing. However, if a SOAP element is marked with the MustUnderstand attribute with a value of 1, it is required. Failure to process the element, generates this exception. |
| ClientFaultCode | A client call was not formatted correctly or did not contain the appropriate information. For example, the client call could have lacked the proper authentication or payment information. It is generally an indication that the message should not be resent without change. |
| ServerFaultCode | An error occurred during the processing of a client call on the server, however the problem was not due to the message contents. For example, an upstream server couldn't respond to a request due to network problems. Typically, with this type of exception, the client call may succeed later. If a XML Web service throws an exception, other than SoapException and the client is calling via SOAP, ASP.NET converts the exception to a SoapException, setting the Code property to ServerFaultCode and throws it back to the client. |
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
SoapException Class | SoapException Members | System.Web.Services.Protocols Namespace | XmlQualifiedName | Subcode | HtmlTable | Actor