using System.ServiceModel; using System.ServiceModel.Web; namespace ZXDService { // 注意: 使用“重构”菜单上的“重命名”命令,可以同时更改代码和配置文件中的接口名“IEventService”。 [ServiceContract] public interface IEventService { [OperationContract] [WebInvoke(Method = "*", ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, UriTemplate = "Event/Get")] string GetEvent(); } }