I have the following code which is trying to post xml constructed data to webservice .asmx but xml constructed data is not reaching webservice file at all.when i make ajax call control is not moving to webservice file at all.Is their any problem with syntax in ajax. This is my code on client side .
$.ajax({
type: "POST",
async: false,
url: "/blkseek2/JsonWebService.asmx/GetList",
datatype:"xml",
data:"<?xml version='1.0'?><keyword1>"+keyword1+ "</keyword1><streetname>"+address1+ "</streetname><lat>"+lat+"</lat><lng>"+lng+ "</lng><radius>"+radius+"</radius>" ,
contentType: "application/xml; charset=utf-8",
// processData: false,
failure: function(XMLHttpRequest, textStatus, errorThrown)
{ ajaxError(XMLHttpRequest,textStatus, errorThrown); },
success: function(xml)
{ ajaxFinish(xml); }
});
This is my webmethod code in webservice which is trying to return xml file as output for the request
[WebMethod]
[ScriptMethod(ResponseFormat = ResponseFormat.Xml)]
public XmlDocument GetList(string keyword1, string streetname, string lat, string lng, string radius)
{
XmlDocument xmldoc= CreateXML( keyword1,streetname,lat,lng,radius);
return xmldoc;
}