Question : CALLING .CS .ASMX WEB SERVICES JAVASCRIPT AND GETTING A RESPONSE

Below is code example. I am calling a Server Side Web Method based in .NET using .cs and .asmx. I can get XML data in a response from the server. I can pass parameters to the server.

What I cannot do is pass parameters to the server and get a response from the same into the same .js method.

Something like this:

MyWebService.Call.LiveService.RunTest(myParam1, myParam2, SucceededCallback, FailedCallback,
        "XmlDocument")

Does anyone know how to do this.

Thank you.
Code Snippet:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
function DeleteItem() {
    var complete = ""
    var myID = document.getElementById("myXmlID").value;
    var myName = document.getElementById("myXMLName").value;
    MyWebService.Call.LiveService.RunTest(SucceededCallback, FailedCallback,
        "XmlDocument")
}

function SucceededCallback(result, userContext, methodName) {

    var xmlString = new XMLSerializer().serializeToString(result);

    //can get to here with Safari.
    xmlDoc = (new DOMParser()).parseFromString(xmlString, "text/xml");
    alert(xmlDoc.xml);
}

function FailedCallback(error) {
    alert("Load Failure");
}

Answer : CALLING .CS .ASMX WEB SERVICES JAVASCRIPT AND GETTING A RESPONSE

Random Solutions  
 
programming4us programming4us