c# webservice怎么样返回json 20
publicclassSalesReport:System.Web.Services.WebService{[WebMethod][ScriptMethod(Respon...
public class SalesReport : System.Web.Services.WebService { [WebMethod] [ScriptMethod(ResponseFormat = ResponseFormat.Json)] public String GetDailySalesReport(DailySalesReportRequest request) { DailySalesReportResponse resp = new DailySalesReportResponse(); DailySalesReportBLL salesReportLogic = new DailySalesReportBLL(); resp.Report = salesReportLogic.GetDailySalesReport(request); resp.Success = false; return new JavaScriptSerializer().Serialize(resp); }这个是源码, 然后我想要返回JSON,但是这个返回的还是xml。怎么样返回JSON?
展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询