Consuming SOAP web service in SENCHA TOUCH?

219 views Asked by At

I have found this post that worked for me but I recieved a HTML response instead of a XML one which is what I need for my app.

How to consume SOAP web service in SENCHA TOUCH?

This is my request to my server... I know I should be doing a POST action as this guy was told, but I still get a root node error.

Is this the proper way to consume a WebService, or there is another way to consume in Sencha using data models and stores? I have already saw an example using CFC but I am using 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!');
    }
});

Here goes the error message:

<?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.
0

There are 0 answers