I am new in ajax, xml and web service. I want to post http request to call webservice with some variable values and xml data with following format:
x=sender&b=receiver&xmlinput=<request><data1>100</data1><data2>200</data2></request>
Here is my ajax code:
//These are the parameters
var a = 'sender';
var b = 'receiver';
var xmlinput = '<request><data1>$('#inputData1').val()</data1><data2>$('#inputData2').val()</data2>';
$.ajax({
url: 'webService.php',
type: "POST",
async: true,
data: "a&b&xml" ,
dataType: 'xml',
contentType: "text/xml",
success: function(xmlData){
},
error: function(jqXHR, textStatus, errorThrown) {
console.log(textStatus, errorThrown);
}
});
Please help me to do that.Thanks.
url: 'webService.php/GET'? and also if data ` data: "xml"` instead ofdata: "a&b&xml"then how about other variablesaandb.Thanks