calling webservice inside js class

Last post 11-02-2009 2:15 AM by Vince Xu - MSFT. 1 replies.

Sort Posts:

  • calling webservice inside js class

    10-29-2009, 4:18 PM
    • Member
      point Member
    • t0r0
    • Member since 10-29-2009, 8:08 PM
    • Posts 1

    I have a javascript class built using prototype. Iside of one class methods i call a webservice like this:

    Namespace.Class.prototype={

    CallFunction:function(){

        Namespace.Service.ScriptMethod(params,this.SuccessMethod);
    }

    SuccessMethod:function(result){

    }

    }

    SuccessMethod is also a member of that class. When i step into the SuccessMethod with debugger  it suddenly looks like a completely different object! I loose all members. I am not a javascript expert and i've been trying to deal with this issue for  several days now. Can anyone help me with this?

    The webservice works fine, it returns results.

    Filed under: ,
  • Re: calling webservice inside js class

    11-02-2009, 2:15 AM
    Answer

    Hi,

    Use this:

     Sys.Net.WebServiceProxy.invoke(
                    "servicePath",
                    "ServiceMethod",
                    false,
                    params,
                    Function.createDelegate(this, this._onMethodComplete),
                    Function.createDelegate(this, this._onMethodFailed),
                    null);


    Vince Xu
    Microsoft Online Community Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Page 1 of 1 (2 items)