Question 1:
XML serialization and RESTful WCF Data Contract cannot match and the class value cannot be passed.
Symptom:
If [Serializable] Attribute is added to the class, serialization can be successful, but the WCF Service cannot recognize it. It is found that the sequence of XML serialization and members in WCF Data Contract must be the same.
Solution:
1. Clear the default namespace of the WCF Data Contract Class header (see the code ).
2. Add XML serialization and WCF Order to all elements (see the Code), including the called class.
= = = id { ; = = userName { ; = = nickName { ; Profile m_profile = = = { { m_profile == = = id { ; = = nation { ; = = gender { ;
Question 2:
In case of the List type, the WCF Service cannot be identified.
Symptom:
The Service cannot identify the object serialized in XML.
Solution:
Add the complete Type of List to the [XmlElement] Attribute (see the code ).
[DataMember(Order = = , Type = (List<SchoolGradeClass> List<SchoolGradeClass> SchoolGradeClassList { ; ; }
What should I do when Google fails to solve the above problems? Experience and knowledge are your secrets. Technology is a developing thing that requires every technician to learn for life. Learning should be part of the programmer's blood! We encourage everyone on the technical front.