I have the following ajax call to webservice to pass json data and get response xml data, when i debug the code the flow is not reaching the webservice
var keyword2 = "{\"keyword1\":\"" + keyword1 + "\",\"streetname\":\"" + address1 + "\",\"lat\":\"" + lat + "\",\"lng\":\"" + lng + "\",\"radius\":\"" + radius + "\"}";
$.ajax({
type: "POST",
async: false,
url: "/blockseek3-9-2010/JsonWebService.asmx/GetList",
data: keyword2,
contentType: "application/json; charset=utf-8",
dataType: "json",
failure: ajaxCallFailed,
success: function(response) {
GDownloadUrl(response, function(data) {
var xml = GXml.parse(response.xml);
var markers = xml.documentElement.getElementsByTagName('marker');
map.clearOverlays();
var sidebar = document.getElementById('sidebar');
sidebar.innerHTML = '';
alert(markers.length);
if (markers.length == 0) {
sidebar.innerHTML = 'No results found.';
map.setCenter(new GLatLng(40, -100), 4);
return;
}
var bounds = new GLatLngBounds();
for (var i = 0; i < markers.length; i++) {
var name = markers[i].getAttribute('name');
var address = markers[i].getAttribute('address');
var distance = parseFloat(markers[i].getAttribute('distance'));
var point = new GLatLng(parseFloat(markers[i]
.getAttribute('lat')), parseFloat(markers[i]
.getAttribute('lng')));
var imagepath = markers[i].getAttribute('imagepath');
var marker = createMarker(point, name, address, imagepath);
map.addOverlay(marker);
var sidebarEntry = createSidebarEntry(marker, name, address,
distance, imagepath);
sidebar.appendChild(sidebarEntry);
bounds.extend(point);
}
map.setCenter(bounds.getCenter(), map.getBoundsZoomLevel(bounds));
});
}
});
});
This will be my code snippet on webservice side
[WebMethod]
[ScriptMethod(ResponseFormat = ResponseFormat.Json)]
public XmlDocument GetList(string keyword1, string streetname, string lat, string lng, string radius)
{
XmlDocument xmlDoc= CreateXML( keyword1,streetname,lat,lng,radius);
//save file to application folder which will be refferd by client application
xmlDoc.Save(@"D:\blockseek3-9-2010\Block3.xml");
return xmlDoc;
}