S
Stan
Although this issue came up in the web service, I believe it is related to
serialization 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.
I want parameterized constructor because
oProxy.Record (new HistoryAttribute[]
{
new HistoryAttribute (1, "abc"),
new HistoryAttribute (2, "xyz")
})
is shorter than
HistoryAttribute at1 = new HistoryAttribute(1, "abc");
HistoryAttribute at2 = new HistoryAttribute(21, "xyz");
oProxy.Record (new HistoryAttribute[]
{
at1, at2
})
Is there a way around it? Perhaps there is an attribute I need to use?
Thanks,
-Stan
serialization 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.
I want parameterized constructor because
oProxy.Record (new HistoryAttribute[]
{
new HistoryAttribute (1, "abc"),
new HistoryAttribute (2, "xyz")
})
is shorter than
HistoryAttribute at1 = new HistoryAttribute(1, "abc");
HistoryAttribute at2 = new HistoryAttribute(21, "xyz");
oProxy.Record (new HistoryAttribute[]
{
at1, at2
})
Is there a way around it? Perhaps there is an attribute I need to use?
Thanks,
-Stan