I have a login button in a jQuery Mobile application. When the login button is pressed a soap service is getting called using $.ajax() method. This works on browser and android phones but the control does not even go inside the $.ajax() in iOS devices. Here is my sample code.
var User = $("#txtUsername").val();
var Psw = $("#txtPwd").val();
var soapMessage = '<?xml version="1.0" encoding="utf-8"?>'
+ '<SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><ns0:UserLogin SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns0="urn:LoginSrvcVi"><userId xsi:type="xsd:string">'+User+'</userId><password xsi:type="xsd:string">'+Psw+'</password></ns0:UserLogin></SOAP-ENV:Body></SOAP-ENV:Envelope>';
$.ajax({
url : myLoginUrl,
type : "POST",
username : User,
password : Psw,
dataType : "xml",
data : soapMessage,
contentType : "text/xml; charset=\"utf-8\"",
success : function(data, textStatus, jqXHR) {
debugger;
$.mobile.loading('hide');
console.log("data" + data);
var x2js = new X2JS();
var test = x2js.xml2json(data);
debugger;
if (test.Envelope.Body.searchUserLoginResponse.Response.messages.item != "Data Retrived Successfully")
{
alert("Success");
}
},
error : function(jqxhr)
{
alert("Error");
}
});
Note : I tried the SOAP url to run in safari but it shows only a blank screen and no data. The chrome on android displays the XML structure.
Need Help. Thanks