【问题标题】:Not getting success in calling asp.net web service from sencha touch从 sencha touch 调用 asp.net Web 服务没有成功
【发布时间】:2012-03-07 22:53:23
【问题描述】:

这是我用来从网络服务获取数据的代码:-

Ext.onReady(function(){ 
      var url = "http://192.168.1.15/JSONDemo/Service1.asmx/getString";
     Ext.Ajax.request({

        method: 'get',
        url: url,
    //  params: {'name':'himanshu'},
        jsonData: { 'name': 'Himanshu'},
    //   headers: { 'Content-Type': 'application/xml; charset=utf-8' },
        success: function (response, request) { 
        alert('Working!') 
        alert(response.responseText)
        console.log('Response:-'+response.responseText)
        },
        failure: function (response, request) {
        alert('Not working!')
        console.log('Response Status:-'+response.status)
        }
        });
});

我的 .net 网络服务代码在这里:-

[WebMethod]
        [ScriptMethod(ResponseFormat = ResponseFormat.Json, UseHttpGet = true)]
        public string getString(string name)
        {
            return "Hello "+name;
        }

我没有得到响应状态为“0”的代码的响应。请帮我解决这个问题。

【问题讨论】:

    标签: android web-services sencha-touch


    【解决方案1】:

    您能否使用网络浏览器从您的服务中获取数据? 使用 http get 时,您应该将参数传递给查询字符串中的方法。 sencha 是否在查询字符串中传递参数? 最好的问候

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-05-13
      • 2013-09-04
      • 1970-01-01
      • 2012-05-26
      • 2012-08-11
      • 1970-01-01
      相关资源
      最近更新 更多