This is my Request
<?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>
<GetConnectionString xmlns="http://tempuri.org/">
<strUsername>string</strUsername>
<strPassword>string</strPassword>
</GetConnectionString>
</soap:Body>
</soap:Envelope>
This will be the response Http
<?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>
<GetConnectionStringResponse xmlns="http://tempuri.org/">
<GetConnectionStringResult>string</GetConnectionStringResult>
</GetConnectionStringResponse>
</soap:Body>
</soap:Envelope>
this my codes when Button was clicked
$("#btnLog").click(function() {
jQuery.support.cors = true;
var soapRequest =
'<?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://www.w3.org/2003/05/soap-envelope"> \
<soap:Body> \
<Authenticate xmlns="http://tempuri.org/"> \
<strUsername>' + $("#uname").val() + '</strUsername> \
<strPassword>' + $("#upass").val() + '</strPassword> \
</Authenticate> \
</soap:Body> \
</soap:Envelope>';
$.ajax({
type: "POST",
url: "http://xxxxxx-xx/xxxxxx/Service1.asmx?op=GetConnectionString",
contentType: "text/xml; charset=\"utf-8",
dataType: "xml",
data: soapRequest,
success: parseRequestResponse,
error: processError,
});
function parseRequestResponse(response) { // when success in connection in ConnectionString
$.mobile.changePage("#panelview"); -- will load a another page
alert(response.responseXML); --alert the srting response
}
function processError() {// when error in connection in ConnectionString
$('#f4').show("slow"); //Animation effect -- there is a load message when error
}
I want to put the response of Web service in a variable. Can anyone tell me how ?..Thank you