首页 新闻 赞助 找找看

WebService bool 类型没有填写 程序报错

0
悬赏园豆:5 [已解决问题] 解决于 2013-06-19 10:10
  public string GetGiftsInfo(string strOperation, string gname, string gcid, string minpoint, string maxpoint, bool isnew, bool ishot, string order, int pagesize, int pageindex)

错内容
System.ArgumentException: 无法将  转换为 System.Boolean。
参数名: type ---> System.FormatException: 该字符串未被识别为有效的布尔值。
   在 System.Boolean.Parse(String value)
   在 System.String.System.IConvertible.ToBoolean(IFormatProvider provider)
   在 System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider)
   在 System.Web.Services.Protocols.ScalarFormatter.FromString(String value, Type type)
   --- 内部异常堆栈跟踪的结尾 ---
   在 System.Web.Services.Protocols.ScalarFormatter.FromString(String value, Type type)
   在 System.Web.Services.Protocols.ValueCollectionParameterReader.Read(NameValueCollection collection)
   在 System.Web.Services.Protocols.HtmlFormParameterReader.Read(HttpRequest request)
   在 System.Web.Services.Protocols.HttpServerProtocol.ReadParameters()
   在 System.Web.Services.Protocols.WebServiceHandler.CoreProcessRequest()

新麦穗的主页 新麦穗 | 初学一级 | 园豆:82
提问于:2013-06-13 09:20
< >
分享
最佳答案
0

你提供了一个string类型的值,但是它不能转换成bool型,你应该检查你传入的参数,是不是符合要求。

收获园豆:5
chenping2008 | 大侠五级 |园豆:9836 | 2013-06-13 09:27

没有传参就直接报错了

新麦穗 | 园豆:82 (初学一级) | 2013-06-13 09:34

@Anders_Zeus: 不是让你不要传参数,而是让你传入正确的参数

chenping2008 | 园豆:9836 (大侠五级) | 2013-06-13 11:48
其他回答(1)
0

那就传一个参数吧 "false"啊什么的

gunsmoke | 园豆:3592 (老鸟四级) | 2013-06-13 10:39
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册