我是个新手,想要在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)
}
});
编辑:好的,我从这里得到了从Web服务调用特定方法的想法。比如我有一个HelloWorld()
方法,它只返回一个字符串,我的网址是http://192.168.1.15:80/himanshu/helloworldwebservice.asmx
。
我可以通过将我的网址设置为以下内容来调用HelloWorld()方法: http://192.168.1.15:80/himanshu/helloworldwebservice.asmx/HelloWorld
但对我来说它不起作用。每次运行程序都会生成“未工作”警报,并且我得到的响应统计数字是500。请帮我理解如何从Web服务调用方法。先感谢你。