I often see someone asked online, how to use ArrayList in WebService. In fact, this is because I don't have a good reason for MSDN.
ArrayList is a linear list object (it is still a bit means.), But WebService does not support it, not a standard variable object, if you have to use the properties in WebService. [XMLRoot "]]
example:
______________________ serialized YouClass.cs
Using system.xml.Serialization;
Namespace Somens
{[Serializable] [XMLROOT ("NewYouClass")] // This property requires the serialization of XML roots Public class YOUSERIALIZABLASS {Private Long M_LID;
Public YOUSERIALIZABEDCLASS () {} public long lid {get {return m_lid;} set {m_lid = value;}}
}
_____________________________ to operate YouClass class A.CS
[XmlInclude (typeof (YouSerializabledClass))] public YouSerializabledClass YouSerializabledClassOperation (Some Var) {YouSerializabledClass.lID = Convert.ToInt64 (Var); return YouSerializabledClass;}
_______________________Webmethod
[WebMethod] [XmlInclude (typeof (YouSerializabledClass))] public YouSerializabledClass YouWebMetho (SomeVar Var) {YouSerializabledClass YouSerializabledClass1 = A.YouSerializabledClassOperation (Var); return YouSerializabledClass;} After this is completed, the mapping sequence generated in the client class.
________________________________ client's Reference.cs
/ / -------------------------------------------------------------------------------------------- ------------------------------ //
// // This source code is automatically generated by Microsoft.vsdesigner 1.1.4322.573.