积极答复者
spring.NET jquery调用webservice

问题
答案
-
请求的格式无效,参考下这个
http://www.codeproject.com/Articles/45275/Create-a-JSON-WebService-in-ASP-NET-with-a-jQu
有可能是web services里面的method缺少了
[ScriptMethod(ResponseFormat = ResponseFormat.Json)]
专注于.NET MIS开发框架,C/S架构,SQL Server + ORM(LLBL Gen Pro) + Infragistics WinForms
- 已标记为答案 lctk 2016年6月4日 15:56
-
Hi lctk,
WebService 要加上'[WebMethod]'前缀才有效吧,什么都不加就被识别成webservice不太可能吧。
另外,你也可以试试在底层吧返回值直接转成Jsonstring 看看, 有时候在webservice里面调用方法会出问题。
Regards,
Moonlight
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey.- 已标记为答案 lctk 2016年6月4日 15:56
-
不用加前缀啊,
public string DQueryDataSet1(string orderField, int pageSize, int currentPage, int orderType, string fields) { SessionModel sessionModel =(SessionModel) HttpContext.Current.Session["sessionmodel"]; if (sessionModel != null) { base.SetSession(sessionModel); } var s = 1; JavaScriptSerializer jsSerializer = new JavaScriptSerializer(); string[][] fields1 = (string[][])jsSerializer.Deserialize(fields, typeof(string[][])); fields1 = fields1.AddUserGridCode(base.GetSession().GridCode); DataSet ds= this.SBFieldsDao.DQueryDataSet(orderField, pageSize, currentPage, orderType, fields1, out s); string s111 = Newtonsoft.Json.JsonConvert.SerializeObject(ds); return s111; }
please verify my account
- 已标记为答案 lctk 2016年6月4日 15:56
-
Hi Lctk,
请上传一个code sample到任意云空间并共享一个链接到这里,我帮你看下。
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey.- 已标记为答案 lctk 2016年6月4日 15:56
全部回复
-
请求的格式无效,参考下这个
http://www.codeproject.com/Articles/45275/Create-a-JSON-WebService-in-ASP-NET-with-a-jQu
有可能是web services里面的method缺少了
[ScriptMethod(ResponseFormat = ResponseFormat.Json)]
专注于.NET MIS开发框架,C/S架构,SQL Server + ORM(LLBL Gen Pro) + Infragistics WinForms
- 已标记为答案 lctk 2016年6月4日 15:56
-
Hi lctk,
WebService 要加上'[WebMethod]'前缀才有效吧,什么都不加就被识别成webservice不太可能吧。
另外,你也可以试试在底层吧返回值直接转成Jsonstring 看看, 有时候在webservice里面调用方法会出问题。
Regards,
Moonlight
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey.- 已标记为答案 lctk 2016年6月4日 15:56
-
不用加前缀啊,
public string DQueryDataSet1(string orderField, int pageSize, int currentPage, int orderType, string fields) { SessionModel sessionModel =(SessionModel) HttpContext.Current.Session["sessionmodel"]; if (sessionModel != null) { base.SetSession(sessionModel); } var s = 1; JavaScriptSerializer jsSerializer = new JavaScriptSerializer(); string[][] fields1 = (string[][])jsSerializer.Deserialize(fields, typeof(string[][])); fields1 = fields1.AddUserGridCode(base.GetSession().GridCode); DataSet ds= this.SBFieldsDao.DQueryDataSet(orderField, pageSize, currentPage, orderType, fields1, out s); string s111 = Newtonsoft.Json.JsonConvert.SerializeObject(ds); return s111; }
please verify my account
- 已标记为答案 lctk 2016年6月4日 15:56
-
Hi Lctk,
请上传一个code sample到任意云空间并共享一个链接到这里,我帮你看下。
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey.- 已标记为答案 lctk 2016年6月4日 15:56