I have a SOAP service in my local system. I have implimented the Java Script code and tested in internet browser, it's working fine but the same code I am using for android application development using phoneGap, I am not getting any response from Android simulator.
请帮我找出问题所在。
//Function called in button click.
function getEmpDetails() {
var e_id = $("#empID").val();
alert("e_id :"+e_id );
var url = "http://localhost:5020/EmployeeService";
var envelope = "<soap:Envelope xmlns:soap='http://www.w3.org/2003/05/soap-envelope'xmlns:inp='http://InputMessageNamespace'>";
envelope += "<soap:Header/>";
envelope += "<soap:Body>";
envelope += "<inp:EmployeeDetailsOperation>";
envelope += "<EmployeeId>"+e_id+"</EmployeeId>";
envelope += "</inp:EmployeeDetailsOperation>";
envelope += "</soap:Body>";
envelope += "</soap:Envelope>";
$.ajax({
url: url,
type: "POST",
dataType: "xml",
contentType: "text/xml;charset=UTF-8",
data: envelope,
beforeSend: function(xhr) { xhr.setRequestHeader("SOAPAction", "/Process Definition"); },
success: OnSuccess,
error: OnError
});
};
function OnSuccess(data, status)
{
alert(status);
alert(data.xml);
}
function OnError(request, status, error)
{
alert('error');
}
function init() {
alert("init");
document.addEventListener("deviceready", deviceInfo, true);
}