[OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.WrappedRequest, ResponseFormat = WebMessageFormat.Json)] public Model1 GetData(string Id1, string Id2) { try { Model1 objModel = new Model1(); DataSet ds = new DataSet(); BAL objBAL = new BAL(); objModel = objBAL.GetData(Id1, Id2); return objModel } catch (FaultException ex) { // error handling code here } } 2) [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.WrappedRequest, ResponseFormat = WebMessageFormat.Json)] public string GetData(string Id1, string Id2) { try { string json = string.Empty; Model1 objModel = new Model1(); DataSet ds = new DataSet(); BAL objBAL = new BAL(); objModel = objBAL.GetData(Id1, Id2); json = new JavaScriptSerializer().Serialize(objModel); return json; } catch (FaultException ex) { // error handling code here } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)