oop_II-6/EHEC_Server/EHEC_Server/ClusterService.asmx.cs

35 lines
1.2 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Web.Script.Services;
using System.Web.Script.Serialization;
namespace EHEC_Server
{
/// <summary>
/// Summary description for ClusterService
/// </summary>
[WebService(Namespace = "http://localhost:50200/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
// 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 ClusterService : System.Web.Services.WebService
{
[WebMethod]
//[ScriptMethod(ResponseFormat = ResponseFormat.Json)]
public void GetJson(HttpContext context)
{
context.Response.ContentType = "application/json";
ClusterConverter cc = new ClusterConverter();
var json = cc.WriteJson();
JavaScriptSerializer js = new JavaScriptSerializer();
context.Response.Write(js.Serialize(json));
//return new JavaScriptSerializer().Serialize(json);
}
}
}