I am getting this error message when I try to ‘Add Web Reference’ to my ASMX proxy project:
**'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)'**
I need to pass name-value pairs to my web service and here is what I came up with:
public class FileService : System.Web.Services.WebService { [WebMethod] public string UploadFile(byte[] incomingArray , string FileName , long FileLengthInBytes , NameValueCollection nvcMetaData)
I now realize I need help changing this (I am new to C# and this part of the .Net framework). If I can get this working, my web service will need to be invoked by ColdFusion (right now I am using an .aspx page for calling the web service). So whatever means I come up with for passing a variable number of NAME-VALUE pairs I need it callable by CF. Thanks in advance.
As an alternative, you can just define a simple NameValue class and receive an array.
If on the client side you have a NameValueCollection you can easily map to your type. Check the sample I posted in this question