Web services 具有多个参数的web服务调用

Web services 具有多个参数的web服务调用,web-services,.net,Web Services,.net,在我的应用程序中,我正在调用基于.Net soap的Web服务。 我的web服务调用功能是: function CallService5() { $.ajax({ type: "POST", url: "http://10.0.2.2:51434/Service1.asmx/GetAllTableStatus", dataType: "json", data: "{}",

在我的应用程序中,我正在调用基于.Net soap的Web服务。 我的web服务调用功能是:

function CallService5() {
            $.ajax({
                type: "POST",
                url: "http://10.0.2.2:51434/Service1.asmx/GetAllTableStatus",
        dataType: "json",
        data: "{}",

        contentType: "application/json; charset=utf-8",
        success: OnSuccess,
        error: OnError
        });
    }

如何添加多个参数?

您可以将参数作为查询字符串添加到服务的url部分

"http://10.0.2.2:51434/Service1.asmx/GetAllTableStatus?para =val"

您阅读了以下文章: 它提供了很好的解决方案


我想你可以这样用

var firstName = document.getElementById("txtFirstName").value;
var lastName = document.getElementById("txtLastName").value;
data : "{'firstName':firstName,'lastName':lastName}"

好的,我怎样才能得到这个参数的值。理想情况下,你的方法GetAllTableStatus接受参数吗?参数名称将位于Para位置,值将位于val位置