Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/231.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 如何在SenchaTouch中使用SOAP web服务?_Android_Web Services_Sencha Touch - Fatal编程技术网

Android 如何在SenchaTouch中使用SOAP web服务?

Android 如何在SenchaTouch中使用SOAP web服务?,android,web-services,sencha-touch,Android,Web Services,Sencha Touch,我是sencha touch的新手,我想在sencha touch中使用soap web服务。我已经为此编写了代码,但问题是我得到的只是简单的HTML内容作为响应,而不是soap对象。我不知道如何从web服务调用特定的方法到sencha touch 这是我的密码:- Ext.Ajax.request({ method: 'get', url: 'http://192.168.1.15:80/himanshu/helloworldwebservice.asmx', suc

我是sencha touch的新手,我想在sencha touch中使用soap web服务。我已经为此编写了代码,但问题是我得到的只是简单的HTML内容作为响应,而不是soap对象。我不知道如何从web服务调用特定的方法到sencha touch

这是我的密码:-

Ext.Ajax.request({

    method: 'get',
    url: 'http://192.168.1.15:80/himanshu/helloworldwebservice.asmx',
    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)
    }

});
EDIT:-好的,我想到从web服务调用一个特定的方法。就像我有
HelloWorld()
方法,它只返回一个字符串,我的url是
http://192.168.1.15:80/himanshu/helloworldwebservice.asmx
。 我可以通过如下设置url来调用HelloWorld()方法:-
http://192.168.1.15:80/himanshu/helloworldwebservice.asmx/HelloWorld


但它对我不起作用。每次我运行程序时,都会生成“not working”(不起作用)警报,我得到的响应统计数据是500。请让我了解如何提前从webservice.Thanx调用方法。

您的代码绝对正确。我认为您正在从服务器端发送HTML数据。请检查Chrome/Safari开发者工具中的响应。另外,使用console.log()函数而不是alert()函数可以获得更好的视图


此外,请打开此url:“http://192.168.1.15:80/himanshu/helloworldwebservice.asmx在浏览器和页面的“查看源代码”中-您将看到您发送的确切内容。

您将无法以这种方式使用SOAP Web服务,因为在asmx url上执行GET请求只会返回列出Web服务方法的页面的HTML内容

使用SOAP Web服务依赖于POST请求,并且需要发送正确的XML SOAP请求。我可能建议您使用类似的方法来执行SOAP调用并检索数据,然后将它们传递回您的Ext代码

希望这有帮助


Nacef

您可以使用:SOAP数据代理

我知道我得到的是URL:-“”的html内容。我的问题是我不知道如何调用上述Web服务中的方法?我还检查了chrome和safari中的响应,但只得到了带有消息“Not Working”的对话框。创建一个新文件,编写一个切换案例并调用不同的函数。发送一个额外的参数,在这个参数上进行切换。但是如何使用外部URL调用web服务的不同方法呢。我的URL:-“192.168.1.15:80/himanshu/helloworldwebservice.asmx”;托管在不同的计算机上。请参见,忘掉Sencha,尝试直接从浏览器访问URL。您自己需要确保如何调用这些方法。所以,如果您在浏览器中获得任何原始数据,同样的数据也将在您的应用程序中使用。我不想在我的应用程序中使用jQuery,那么您可以告诉我如何通过AJAX调用实现这一点。很抱歉,有一段时间我没有查看邮箱。你成功了吗?你能分享一下解决方案吗?我很想知道你是如何做到的it@himanshu:你能分享你的解决方案吗。因为我已经寻找了很长一段时间的方法来实现这一点。这是我发布的有问题的工作代码…我的webservice问题现在已经解决了。在几天前我发现了同样的问题,然后得到了解决方案。