|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Serialization of the class with parameterized constructorserialization in general. This is my web service interface definition: ======== public class HistoryAttribute { private int key; private string value; public HistoryAttribute() { key = -1; value = string.Empty; } public HistoryAttribute(int key, string value) { this.key = key; this.value = value; } } [WebServiceBinding( Name = "ReportService", Namespace = "http://PC.WS2", ConformsTo = WsiProfiles.BasicProfile1_1, EmitConformanceClaims = true)] interface IProHistoryService { [WebMethod] void Record(HistoryAttribute[] attributeList); } =================== HistoryAttribute class has parameterized constructor: public HistoryAttribute(int key, string value) { this.key = key; this.value = value; } Everything compiles fine, but when a proxy class is generated by WSDL utility, this constructor is missing: ======================= [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://PC.WS2")] public partial class HistoryAttribute { private int keyField; private string valueField; } ============= Only first, default constor is there, and again, no error or warrnings. I tried to hack it and put parameterized constructo manually, but then I got an error message during calling the webservice. Is there a way around it? Maybe there is an attribute I need to use? Thanks, -Stan |
|||||||||||||||||||||||