I have a big problem regarding to call a web-service through Jquery .
I am developing one phonegap application same as Android application right now.In that I have to call a web-service and fetch data from there.I tried to solve it in my way but i didn't find proper solution.
My web-service is built in .NET using SOAP . And now i want to call that web-service through my HTML page using jquery . So, Please help me to solve this problem.
Thanks in Advance.
Here is some links I got from research
Google group phonegap group discussion
Another google group discussion
Following are some stack overflow question-answers which may can solve your problem ,
How call SOAP based web-Service using PhoneGap in iPhone?
How call SOAP based web-Service using PhoneGap and jQuery in Android?
You can use XMLHttpRequest to connect with external domain this is the sample code
function connectXml()
{
var request = new XMLHttpRequest();
var wsUrl="http://www.somedomain.com/servicexml"
request.open("POST", wsUrl, true);
request.onreadystatechange = function() {
if (request.readyState == 4) {
if (request.status == 200 || request.status == 0) {
var data = request.responseText;
alert(request.responseText);
}}}}
Note:Give access to the domain in config.xml eg:access origin="http://somedmain.com". Add user INTERNET permission in AndroidManifest.xml eg:"uses-permission android:name="android.permission.INTERNET"/uses-permission"
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.