How to use SOAP web service in SENCHA TOUCH?

I am new to sencha touch and I want to use soap-web service in sencha touch. I wrote code for this reason, but the problem is that I am getting just HTML content as an answer, not a soap object. And I do not know how to name a specific method from the web service for sencha touch.

Here is my code: -

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) } }); 

EDIT: - Well, I had an idea to call a specific method from a web service from here . there is a HelloWorld() method that returns only one row, and my url is http://192.168.1.15:80/himanshu/helloworldwebservice.asmx . I can call the HelloWorld () method by setting my url as follows: - http://192.168.1.15:80/himanshu/helloworldwebservice.asmx/HelloWorld

But it does not work for me. Every time I run the warning “Not working”, and 500 is the response statistics that I receive. Please let me know how I can call methods from webservice.Thanx in advance.

+3
source share
3 answers

You won’t be able to use your SOAP web service this way, since executing a GET request on urm asmx will simply return you the HTML content for the page listing your webservice methods.

Consumption of SOAP web services is dependent on POST requests and requires the submission of a valid XML SOAP request. I can suggest that you use something like http://archive.plugins.jquery.com/project/jqSOAPClient to make your SOAP calls and retrieve your data, and then pass it back to your Ext code.

Hope this helps

Nacef

+3
source

Your code is ok. I think you are sending HTML data from the server side. Check the answer in Chrome / Safari Developer Tools. Also, use the console.log () function instead of the alert () function for a better view.

Also open this URL: "http://192.168.1.15:80/himanshu/helloworldwebservice.asmx" in the browser and "View source" on the page - you will see what exactly you send.

0
source

Source: https://habr.com/ru/post/891136/


All Articles