Last post May 26, 2014 10:43 PM by Fuxiang Zhang - MSFT
May 26, 2014 02:58 AM|Raj4MS|LINK
I have Added [XmlElement(ElementName = "SerialNumber")] in WCF service contract. but after adding as refernce, when I see in reference.cs this attribute is not there, So the SerialNumber is coming in xml file. Is there any other way to do this please help
me on this.
May 26, 2014 10:43 PM|Fuxiang Zhang - MSFT|LINK
Thank you post the issue to asp.net forum.
I have Added [XmlElement(ElementName = "SerialNumber")] in WCF service contract. but after adding as refernce, when I see in reference.cs this attribute is not there,
As known that the properties attributed with the DataMember or XmlElement attributes only define what will be included in the generated WSDL/XSD.
The client will generate it's own classes based on the wsdl/xsd to use for communication with the service. It does not use the same classes which are used on the server.
So the XmlElement will not be seen in the client side class. What we cannot get in the client like below points.
# any constructors defined in the DataContract class
# any private [DataMember] properties/fields (the client will always generate public properties/fields)
# any behaviour defined in the DataContract class
Hope that helps, thanks.