【发布时间】:2014-11-11 19:49:46
【问题描述】:
我一直在对煎茶上的 HelloWorld 进行一些测试,但无论如何我无法让它在 responseXML 上工作。我的代码是这样的......
Ext.Ajax.request({
url: 'http://url/MobileService/MobileWS.asmx',
callbackKey: 'callback',
scope: 'this',
method: 'POST',
headers: {'Content-Type': 'application/soap+xml; charset=utf-8; action="http://tempuri.org/HelloWorld"'},
success: function(response) {
// OK
alert("ok");
alert(response.responseXML);
},
failure: function(response) {
// KO
alert("errpr");
alert(response.resposeText);
},
xmlData: '<?xml version="1.0" encoding="utf-8"?>\n<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns="http://tempuri.org/HelloWorld"><soap:Header/><soap:Body><HelloWorldResult>string</HelloWorldResult></soap:Body></soap:Envelope>'
});
这段代码在 responseText 中返回了我需要的所有 xml 信息,但没有显示在 responseXML 中。此外,我不知道如何查找 XML 键并获取值。
当我想使用更大的服务时遇到了真正的问题,我必须在其中包含一些输入参数。问题,它根本不起作用。也许果酱做错了。我只是将它添加到标题键之前的其他代码中。
params:{filter:'SomeName'}
我一直在阅读一些 sencha 文档,我发现应该有一些方法来创建模型和源以使用 SOAP WebService,但我无法做到这一点。有什么帮助吗?
【问题讨论】:
标签: web-services extjs soap sencha-touch