如何在 SENCHA TOUCH 中使用 SOAP Web 服务? [英] How to consume SOAP web service in SENCHA TOUCH?

查看:30
本文介绍了如何在 SENCHA TOUCH 中使用 SOAP Web 服务?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 sencha touch 的新手,我想在 sencha touch 中使用肥皂网络服务.我为此编写了代码,但问题是我得到的只是纯 HTML 内容作为响应,而不是肥皂对象.而且我不知道如何从 Web 服务调用特定方法到 sencha touch.

I am new to sencha touch and i want to consume soap web service in sencha touch.I have written code for this cause, but the problem is that I am getting just plain HTML content as response not the soap object. And I dont know how to call a specific method from web service to 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)
    }

});

- 好的,我想到了从 这里.就像我有 HelloWorld() 方法它只返回一个字符串,我的 url 是 http://192.168.1.15:80/himanshu/helloworldwebservice.asmx.我可以通过像这样设置我的 url 来调用 HelloWorld() 方法:- http://192.168.1.15:80/himanshu/helloworldwebservice.asmx/HelloWorld

- Ok i got the idea to call a specific method from web service from here.Like i have HelloWorld() method which only returns a single string and my url is http://192.168.1.15:80/himanshu/helloworldwebservice.asmx. I can call HelloWorld() method by setting my url like this :- http://192.168.1.15:80/himanshu/helloworldwebservice.asmx/HelloWorld

但它对我不起作用.每次我运行程序时都会生成不工作"警报,500 是我得到的响应统计信息.请让我了解如何从网络服务调用方法.提前谢谢.

But its not working for me.Every time i run the program 'Not Working' alert generates and 500 is the response stats i gets.Please make me understand that how can i call methods from webservice.Thanx in advance.

推荐答案

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

You will not be able to consume your SOAP webservice in this way, since performing a GET request on the asmx url will just return you the HTML content for the page listing your webservice methods.

使用 SOAP 网络服务依赖于 POST 请求,并且需要您发送正确的 XML SOAP 请求.我可能会建议您使用类似 http://archive.plugins.jquery.com/project/jqSOAPClient 执行您的 SOAP 调用并检索您的数据,然后将它们传递回您的 Ext 代码.

Consuming SOAP webservices relies on POST requests and need that you send a correct XML SOAP request. I may suggest you to use something like http://archive.plugins.jquery.com/project/jqSOAPClient to execute your SOAP calls and retrieve your data and then pass them back to your Ext code.

希望能帮到你

Nacef

这篇关于如何在 SENCHA TOUCH 中使用 SOAP Web 服务?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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