Preface
This is a mck note about using the MS messagequeue Microsoft Message Queue component now moved to the blog
Throw when MSMQ is used to send messages:
Icontlliton <t> is an error in interface serialization failure.
The message to be sent is a complex entity:
Public class modelone
{
Public string name {Get; set ;}
Public modeltwo model {Get; set ;}
}
Public class modeltwo
{
Public string name {Get; set ;}
Public ilist <modlethree> List {Get; set ;}
}
In modeltwo, APIs in modeltwo cannot be serialized. However, list does not need to be serialized.
To specify the attributes to be serialized, you can use
[Xmlignore] label. This label indicates attribute fields that do not need to be serialized.
For more information about XML
Attriabute during serialization:
The system. xml. serialization namespace has a series of feature classes used to control the control of complex type serialization. For example
Xmlelementattribute, xmlattributeattribute, xmlarrayattribute,
Xmlarrayitemattribute and xmlrootattribute
[Xmlroot ("cat")]
Public class cat
{
// Define the serialization of the color attribute as the attributes of the cat Node
[Xmlattribute ("color")]
Public
String color {Get; set ;}
// The speed attribute is not serialized.
[Xmlignore]
Public int Speed {
Get; set ;}
// Serialize the saying attribute to an XML sub-element.
[Xmlelement ("saying")]
Public
String saying {Get; set ;}
}
}
You can use xmlelement to specify the property to be serialized as a sub-node (the property will be serialized as a sub-node by default), or use the xmlattribute feature to specify the property to be serialized as an XML node. You can also use the xmlignore feature to modify the serialization requirements.ProgramModify attributes without serialization
Reference
Http://www.cnblogs.com/luomingui/archive/2010/03/08/1680933.html