English 中文(简体)
如何与网络服务连接
原标题:how connect with web service

我试图从网络服务获取一些数据:

$.ajax({
    type:  POST ,
    url: "http://192.******.asmx?op=GetJSONString",
    method: "serverCallback",
    data: "Select con.cod as codigo, con.res as descripcion from con where ide>0",
    success: function(data){alert(data)},    
});

我怎样才能得到回回的JSON数据?

问题回答

这就是我的呼声,你能更具体地说说你的问题吗?

$.ajax({
    type: "POST", 
    data: "SOME DATA",      
    dataType: "json",
    url : "/myapp/service.json",
    cache: false,
    error: function() {     
                         alert("There was an issue");
        }
    ,
    success: function(data) 
    {                   
            processJson(data); 
    }
});

我还将张贴与我一起工作过的阿斯马克斯服务内容。

在下面的例子中,“url”:“/service/ details.asmx/Reject”,“/reject”是网络服务(asmx)文件中的方法名称。

  $.ajax({
            "dataType":  json ,
            "contentType": "application/json; charset=utf-8",
            "type": "POST",
            "url": "/service/Details.asmx/Reject",
            "data": "{"itemId":"" + id + "","comment":"" + comms + ""}",
            "success":
                        function (msg) {
                          alert("Yea it worked!");
                            });
                        }
        });




相关问题
IIS 6.0 hangs when serving a web-service

I am having issues with one of our web-services. It works fine on my development machine (win XP) whether I host it as a separate application or using cassini from Visual studio. Once I deploy on the ...

ASP.net web services

I am using a web service which sets the Thread.CurrentPrincipal object while logging in and soon later when another webmethod of the same web service accesses Thread.CurrentPrincipal, its different/...

Unity Container Disposing and XML Web Service

I am registering some wrapers over un-managed objects in container. How can I dispose of them at the end of the container s lifetime? Please bear in mind I have an XML Web service.

SharePoint : web service permission error

I have a sharepoint site, and I am calling a standard sharepoint web service. I create the web service request like this : wsDws.Url = this.SiteAddress + @"/_vti_bin/Dws.asmx"; When I use ...

热门标签