I have a page method:
var test = "<?xml version='1.0'?><query><drawioIan>This is Ians XML</drawioIan></query>";
PageMethods.GetDocument(encodeURI(test), onSuccess, onFailure);
function onSuccess(result) {
debugger;
//XML returned, so need to drill into it.
alert(result.firstChild.childNodes[0].innerHTML);
}
function onFailure(error) {
debugger;
alert(error);
}
That is suppoused to call a webmethod:
[WebMethod]
[ScriptMethod(ResponseFormat = ResponseFormat.Xml, UseHttpGet = true, XmlSerializeString = true)]
public static System.Xml.XmlDocument GetDocument(string svg)
{
string test = HttpUtility.UrlDecode(svg);
//Response Is sent back as xml, you might be able to send back json instead - might be handier.
System.Xml.XmlDocument xmlDoc = new System.Xml.XmlDocument();
xmlDoc.LoadXml("<root><item>Hello World</item></root>");
return xmlDoc;
}
The webmethod does not get called but I am receiving a status code 200
Retuned is the whole html page:
The breakpoint on the webmethod does not get triggered either. Does anyone have any idea what the issue may be?
EDIT:
WebMetho gets skipped but still comes back with onSuccess():