[XmlRoot (" funderService ")]
Public class Request_gl
{
Public Request_gl ()
{
ParamList=new List
}
[XmlAttribute]
Public string functionName {get; The set; }
[XmlArrayItem (" vaule ")]
Public List
Public string beanToXml ()
{
//ready for ordering column object
Var format=new XmlSerializer (typeof (Request_gl));
Var stringBuilder=new stringBuilder ();
//set the order ordering XML format
XmlWriterSettings XWS=new XmlWriterSettings ();
XWS. Indent=true;
XWS. OmitXmlDeclaration=true;
XWS. Encoding=Encoding. UTF8;
XmlWriter XmlWriter=XmlTextWriter. Create (stringBuilder, XWS);
//remove to node XMLNS: xsi="http://www.w3.org/2001/XMLSchema-instance" XMLNS: XSD="http://www.w3.org/2001/XMLSchema" attribute
XmlSerializerNamespaces _namespaces=new XmlSerializerNamespaces (
New XmlQualifiedName [] {
New XmlQualifiedName (string. The Empty string. Empty)
});
XmlWriter. WriteStartDocument (true);
Format. Serialize (xmlWriter, this _namespaces);
Return the stringBuilder. ToString ();
}
}
need to serialize into XML format below
But actually serialized from is it
Much & lt; ParamList> Node
Please type how to define to serialize ChengXiang want
CodePudding user response:
[XmlArrayItem (" vaule ")]
//replace for
[XmlElement (" vaule ")]