没有获得成功,从煎茶触摸调用asp.net web服务 [英] Not getting success in calling asp.net web service from sencha touch

查看:154
本文介绍了没有获得成功,从煎茶触摸调用asp.net web服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

下面是我的code,我现在用的摆脱Web服务数据: -

Here's my code which i am using to get data from web service:-

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 Web服务code是在这里: -

my .net web service code is here:-

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

我得到这个code'0'的反应没有反应status.Please帮我摆脱这个问题。

I am getting no response with this code with '0' response status.Please help me get rid of the problem.

推荐答案

您可以使用Web浏览器来获得从服务的数据?
当使用HTTP GET您应该将参数传递给在查询字符串的方法。是煎茶传递查询字符串参数?
最好的问候

Are you able to get data from your service using a web browser? When using http get you should pass the parameters to the method in query string. Is sencha passing the parameters in query string? Best regards

这篇关于没有获得成功,从煎茶触摸调用asp.net web服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆