在WebService中定义方法,有一些注意的地方:

  (1) 方法上面需要增加 [WebMethod] 属性,标志该方法是一个WebService方法;

  (2)方法的返回值可以为void、string、int、bool、DataSet等类型,不能为Dictionary<object,object>等特殊类型。

          如果真的想使用Dictionary<object,object>字典类型,需要实现相关接口。

  (3)方法的参数类型必须是可序列化的类型,比如string、int、bool、DataSet、List<T>等类型;

          但是不能为IList<T>等类型。

 

相关文章:

  • 2021-10-31
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-20
  • 2021-11-06
猜你喜欢
  • 2022-12-23
  • 2022-01-18
  • 2022-12-23
  • 2022-12-23
  • 2021-12-18
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案