当我尝试“添加Web引用”到我的ASMX代理项目时收到此错误消息:
**"To be XML serializable,types which inherit from ICollection must have an implementation of Add(System.String) at all levels of their inheritance hierarchy. System.Collections.Specialized.NameValueCollection does not implement Add(System.String)"**
我需要将名称 – 值对传递给我的Web服务,这就是我想出的:
public class FileService : System.Web.Services.WebService { [WebMethod] public string UploadFile(byte[] incomingArray,string FileName,long FileLengthInBytes,NameValueCollection nvcMetaData)
我现在意识到我需要帮助改变这一点(我是C#的新手和.Net框架的这一部分).如果我可以使用它,我的Web服务将需要由ColdFusion调用(现在我使用.aspx页面来调用Web服务).因此无论我想出什么方式来传递可变数量的NAME-VALUE对,我都需要它可由CF调用.提前致谢.
解决方法
原文地址:https://www.jb51.cc/c/119243.html
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。