Sencha touch 在SENCHA TOUCH中使用SOAP web服务?

Sencha touch 在SENCHA TOUCH中使用SOAP web服务?,sencha-touch,sencha-architect,Sencha Touch,Sencha Architect,我发现这篇文章对我很有用,但我收到了一个HTML响应,而不是我的应用程序所需要的XML响应 这是我对服务器的请求。。。我知道我应该按照这家伙说的做一个POST操作,但我仍然得到一个根节点错误 这是使用Web服务的正确方式,还是使用数据模型和存储在Sencha中有另一种使用方式?我已经看到了一个使用CFC的示例,但我正在使用IIS 7.5 POST /url/mobilews.asmx HTTP/1.1 Host: 10.0.1.182 Content-Type: text/xml; chars

我发现这篇文章对我很有用,但我收到了一个HTML响应,而不是我的应用程序所需要的XML响应

这是我对服务器的请求。。。我知道我应该按照这家伙说的做一个POST操作,但我仍然得到一个根节点错误

这是使用Web服务的正确方式,还是使用数据模型和存储在Sencha中有另一种使用方式?我已经看到了一个使用CFC的示例,但我正在使用IIS 7.5

POST /url/mobilews.asmx HTTP/1.1
Host: 10.0.1.182
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://tempuri.org/HelloWorld"
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <HelloWorld xmlns="http://tempuri.org/" />
  </soap:Body>
</soap:Envelope>




Ext.Ajax.request({
    method: 'GET',
    url: 'http://url/mobileservice/mobilews.asmx?op=HelloWorld',
    params: { method: 'HelloWorld', format: 'json' },
    success: function (response, request) {
        alert('Working!');
        alert(response.responseText);


    },
    failure: function (response, request) {
        alert('Not working!');
    }
});
POST/url/mobilews.asmx HTTP/1.1
主持人:10.0.1.182
内容类型:text/xml;字符集=utf-8
内容长度:长度
SOAPAction:“http://tempuri.org/HelloWorld"
Ext.Ajax.request({
方法:“GET”,
网址:'http://url/mobileservice/mobilews.asmx?op=HelloWorld',
参数:{method:'HelloWorld',format:'json'},
成功:功能(响应、请求){
警惕(‘工作’);
警报(response.responseText);
},
故障:功能(响应、请求){
警报(“不工作!”);
}
});
下面是错误消息:

<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><soap:Fault><soap:Code><soap:Value>soap:Receiver</soap:Value></soap:Code><soap:Reason><soap:Text xml:lang="en">System.Web.Services.Protocols.SoapException: Server was unable to process request. ---&gt; System.Xml.XmlException: Data at the root level is invalid. Line 1, position 1.
soap:ReceiverSystem.Web.Services.Protocols.SoapException:服务器无法处理请求。--System.Xml.XmlException:根级别的数据无效。第1行,位置1。

你能在问题中添加你的
Ext.Ajax.request
代码吗?我刚刚用Ajax请求更新了帖子。谢谢。SOAP请求通常要求是
POST
。你的问题还有什么遗漏吗?当
Ext.data.Reader
对象无法解析响应时,会发生根节点错误,但这不会涉及
Reader
对象。你能提供你得到的确切错误吗?@sherb谢谢你的回答。我已经在帖子中提供了错误消息。。。您是否有关于如何在SENCHA TOUCH上执行SOAP请求的示例代码?我是sencha的新手,遇到了很多麻烦。服务器端错误是因为它不理解请求而产生的。您需要将请求主体附加到
xmlData
参数中,并使用
POST
作为方法。您是否已成功地将此web服务与其他平台或工具(如SoapUI)一起使用?我会先这样做,然后关注Sencha触摸编码。