public ActionResult Pub() { try { localhost.Service1 sa = new localhost.Service1(); var a = sa.GetData(123, true); return(Json(new { state = 0, msg = a })); } catch (Exception e) { return(Json(new { state = 0, msg = e.Message })); } }