Sys.Net.WebServiceError Class
Represents the object type that is returned to the browser when a Web service raises an error.
Namespace: Sys.Net
Inherits: None
Members
Name |
Description |
---|---|
Initializes a new instance of the Sys.Net.WebServiceError class when implemented in a derived class. |
|
Gets the raw error information. |
|
Gets the exception type of the error. |
|
Gets the error message returned by the error. |
|
Gets the status code for the HTTP response. |
|
Gets the stack trace that is returned by the server. |
|
Gets a value that indicates whether the Web service failed because it timed out. |
Remarks
The WebServiceError is the type of the object that is returned to the failed callback function.
Example
Description
The following example shows how a failed callback function accesses the WebServiceError object. For more information, see Calling Web Services from Client Script in ASP.NET AJAX.
Code
// This is the failed callback function.
function OnFailed(error)
{
var stackTrace = error.get_stackTrace();
var message = error.get_message();
var statusCode = error.get_statusCode();
var exceptionType = error.get_exceptionType();
var timedout = error.get_timedOut();
// Display the error.
var RsltElem =
document.getElementById("Results");
RsltElem.innerHTML =
"Stack Trace: " + stackTrace + "<br/>" +
"Service Error: " + message + "<br/>" +
"Status Code: " + statusCode + "<br/>" +
"Exception Type: " + exceptionType + "<br/>" +
"Timedout: " + timedout;
}
See Also
Reference
Sys.Net.WebRequestManager Class