Note that there are some explanatory texts on larger screens.

plurals
  1. POError with passing json constructed data and receiving xmldocument as output
    text
    copied!<p>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 </p> <pre><code>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 &lt; 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)); }); } }); }); </code></pre> <p>This will be my code snippet on webservice side</p> <pre><code>[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; } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload