namespace Sprite.Call
{
///
/// Summary description for LiveCallsService
///
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
[System.Web.Script.Services.ScriptService]
public class LiveCallsService : System.Web.Services.WebService
{
[WebMethod]
[ScriptMethod(ResponseFormat = ResponseFormat.Xml)]
public XElement GetDirectory()
{
DirectoryConstructor myDirectoryConstructor = new DirectoryConstructor();
XElement myDirectory = new XElement(myDirectoryConstructor.GoSites());
//myDirectory.Save(@"C:\SpriteMasterPage\XSLscripts\sites.xml");
return myDirectory;
}
}
}
var xmlDoc = Sarissa.getDomDocument();
xmlDoc.async = false;
// create an object from the xsl
var xslDoc = Sarissa.getDomDocument();
xslDoc.async = false;
xslDoc.load("XSLscripts/sites.xsl");
function CallGetDirectory() {
Sprite.Call.LiveCallsService.GetDirectory(
SucceededDirectoryCallback, FailedCallback,
"XmlDocument")
}
function SucceededDirectoryCallback(result, userContext, methodName) {
xmlDoc.load(result);
showDetail('0');
}
function FailedCallback(error) {
alert("Load Failure");
}
function showDetail(id) {
var xsltProc = new XSLTProcessor();
xsltProc.importStylesheet(xslDoc);
xsltProc.setParameter('', "detail-id", id);
var transformResult = xsltProc.transformToDocument(xmlDoc);
//alert(new XMLSerializer().serializeToString(transformResult));
document.getElementById("structureContainer").innerHTML = new XMLSerializer().serializeToString(transformResult);
}
if (typeof (Sys) !== "undefined") Sys.Application.notifyScriptLoaded();
function verify() {
// 0 Object is not initialised
// 1 Loading object is loading data
// 2 Loaded object has loaded data
// 3 Data from object can be worked with
// 4 Object completely initialised
if (xmlDoc.readyState != 4) {
return false;
}
}
|