【问题标题】:calling a webservice with jquery that accepts five STRING params?使用接受五个字符串参数的 jquery 调用 web 服务?
【发布时间】:2009-06-01 19:27:25
【问题描述】:

是否可以调用接受 5 个字符串参数而不通过 json 发送的 web 服务? (这是推荐的)我创建了一个 Web 服务,其方法接受 5 个字符串参数。我有我的 jquery

                $.ajax({
                type: "POST",
                url: "Service.aspx/CreateClient",
                data: "{}",
                contentType: "application/json; charset=utf-8", //// ERMMM ???
                dataType: "json", // ERMMM?
                success: function(msg) {
                    alert(msg.d);
                },
                error: function() {
                    alert('error');
                }

            });

不使用 jquery 的旧方法是这样做

            this.para.add("Name", name);
            this.para.add("ClientNum", clnum);
            this.para.add("Email", email);
            this.para.add("Register", register);
            this.para.add("Message", message);

            SOAPClient.invoke(this.url, "MyService.aspx/CreateClient", this.para, true, this.completeDone, this);

在另一端着陆并填写所有参数....

推荐的方式是什么?

【问题讨论】:

    标签: asp.net jquery ajax web-services soap


    【解决方案1】:

    为什么不使用查询字符串变量并避免 SOAP 协议的开销?

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-06-14
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多