locked
What can i do ? RRS feed

  • Question

  • User-543240016 posted

    I write that code

    function onSuccess(result, userContext, methodName)
    {

    userContext.innerHTML = " <b><u>" + result + " </b></u>";

    }
    function onFailure(result, userContext, methodName) { }
    function add()
    {

    var servicePath = "http://localhost/WebServicesViaJSON/Math.asmx";
    var methodName = "Add";
    var useGet = false;
    var xValue = $get("firstNumber").value;
    var yValue = $get("secondNumber").value;
    var params = {x : xValue, y : yValue};
    var userContext = $get("result");
    var webServiceProxy = new Sys.Net.WebServiceProxy();
    webServiceProxy.set_timeout(0);
    request = webServiceProxy._invoke(servicePath, methodName, useGet, params,
    onSuccess, onFailure, userContext);

    }

    when i wite webServiceProxy and i drop (.) when i cannot find _invoke

    i don't know why can u  tell me 

    Wednesday, July 2, 2008 7:27 AM

Answers

  • User-315082118 posted

    invoke is a “static” method of WebServiceProxy, remove the line "var webServiceProxy = new Sys.Net…" and change it for:

    <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p> Sys.Net.WebServiceProxy.invoke(servicePath, methodName, useGet, params, onSuccess, onFailure, userContext, null);<o:p></o:p>

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, July 2, 2008 9:00 AM

All replies

  • User-315082118 posted

    invoke is a “static” method of WebServiceProxy, remove the line "var webServiceProxy = new Sys.Net…" and change it for:

    <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p> Sys.Net.WebServiceProxy.invoke(servicePath, methodName, useGet, params, onSuccess, onFailure, userContext, null);<o:p></o:p>

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, July 2, 2008 9:00 AM
  • User-543240016 posted

     Thank you for your help.

    Wednesday, July 2, 2008 11:28 PM