How to add List<int> to a DataContract of a web service -
i want create datacontract class 2 different list members. when try start web service, error method, sendemail, not supported test wcf client. data contract:
[datacontract] [knowntype(typeof(int[]))] public class emailinfo { private string strfromuserid = string.empty; private string strfromaddress = string.empty; private string strfromname = string.empty; private object lstindividualids = null; private object lstgroupids = null; private string strsubject = string.empty; private string strmessage = string.empty; [datamember] public string fromuserid { { return strfromuserid; } set { strfromuserid = value; } } [datamember] public string fromaddress { { return strfromaddress; } set { strfromaddress = value; } } [datamember] public string fromname { { return strfromname; } set { strfromname = value; } } [datamember] public object individualids { { return lstindividualids; } set { lstindividualids = value; } } [datamember] public object groupids { { return lstgroupids; } set { lstgroupids = value; } } [datamember] public string subject { { return strsubject; } set { strsubject = value; } } [datamember] public string message { { return strmessage; } set { strmessage = value; } } }
this method uses datacontract:
public string sendemail(emailinfo emailinfo) { string tstrerrormsg = string.empty; sqlconnection sqlconn = null; try { return tstrerrormsg; } catch (exception ex) { return null; } { if (sqlconn != null) { sqlconn.close(); } } }
i have datamember in datacontract of type list. how add type datacontract?
i got web service run changing lstindividualids , listgroupids list. thought had use objects. in case else has problem...
object lstindividualids -> list listindividualids same groupids. allowed test client run service..
Comments
Post a Comment