Documentation for: ASP.NET Ajax Version 1.0

This documentation is for a previous version. For the current released version, see the ASP.NET Ajax documentation on MSDN.

 

 

 

 

 

 

 

Sys.Net.WebServiceError Class

Introduction

Represents the object type returned to the browser when a Web service issues an error.

Namespace: Sys.Net

Inherits: None

Members

Name

Description

exceptionType Property

Gets the exception type of the error.

message Property

Gets the error message returned by the error.

statusCode Property

Gets the status code for the HTTP response.

stackTrace Property

Gets the stack trace returned by the server.

timedOut Property

Gets a value that indicates whether the Web service failed because it timed out.

Remarks

The WebServiceError is the type of the object 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.

Code

javascript

// 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;
}