"requestComplexService" - Error object model (& best debug practices)

Rate It (1)

Last post 08-08-2007 5:56 PM by RainMan. 2 replies.

Sort Posts:

  • "requestComplexService" - Error object model (& best debug practices)

    08-08-2007, 3:14 PM
    • Loading...
    • RainMan
    • Joined on 08-07-2006, 5:09 PM
    • California
    • Posts 3

    Hi, I have AJAX v 1.0.61025.0 token 31bf3856ad364e35, XP, VS 2005 Team Systems:

    I have this AJAX call:

    requestComplexService = MyWebServiceManager.MyMethodCall (params[], myMethod_OnComplete, myMethod_OnTimeout);

    That AJAX call returns a collection of custom objects, and runs fine most of the time - but when "params[]" contain certain values, the call fails, which executes the "myMethod_OnTimeout(errObj)" function.

    I have stepped through my C# web service code using VS2005 and there is no error in the web service itself (the collection of custom objects is successfully built and should return to the "myMethod_OnComplete" function).

    In the "method_OnTimeout" function, I know typeof(errObj) = "object" but I have no idea what the API is for "errObj" object.

    Can someone tell me where I can find the object model for that response object ("errObj")?  (hoping this object contains useful info).

    Also while on the subject, does anyone have best practice suggestions for debugging this type of AJAX call (best way to figure out why I'm hitting OnTimeout instead of OnComplete)?

    Thanks,

    Ray

  • Re: What is the error object model (& best debug practices for) for "requestComplexService"

    08-08-2007, 4:02 PM
    Answer

    The Complete Signature Looks Like the Following:

    SimpleService.SimpleMethod(Your Params in Comma Separated,
                                               function(result) // Success Handler, Optional
                                               {
                                               },
                                               function(exception) // Error Handler, Optional
                                               {
                                               },
                                               userContext// Context data
                                               );

    There is no OnTimout in the Current Version. In the ErrorHandler you will find the following properties:
    exception.get_exceptionType() - > Type of exception
    exception.get_message() -> Error Message
    exception.get_stacktrace() -> Returns the stacktrace of the server
    exception.get_Timeout() -> Returns true if the call timeouts

    FYI The exception object in the OnErro callback is not a generic javascript Error object instead it is a special class called WebServiceError.

    There is a basic tutorial in online doc http://www.asp.net/AJAX/Documentation/Live/tutorials/ConsumingWebServicesWithAJAXTutorial.aspx check the Handling Errors in Web Service Method Calls.

    Long Live .NET
    Kazi Manzur Rashid (Amit)
    _________________________
    http://weblogs.asp.net/rashid/
  • Re: What is the error object model (& best debug practices for) for "requestComplexService"

    08-08-2007, 5:56 PM
    • Loading...
    • RainMan
    • Joined on 08-07-2006, 5:09 PM
    • California
    • Posts 3

    Awesome Kazi, thank you!

    That's just what I was looking for.

    Now I know my error is "Maximum length exceeded"

    Ray

Page 1 of 1 (3 items)
Microsoft Communities
Page view counter