I'm trying to create xml seriaizable collection class (below), but the xml keeps coming out wrong. In the resulting xml from the web service (below) the "ArrayOfAlarmProcessor" tag should really be "Processors" and the "AlarmProcessor" tag should be "Processor".
<ArrayOfAlarmProcessor xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://mycompany/webservice/NetworkAlarms">
<AlarmProcessor>
<IP>100.100.100.100</IP>
</AlarmProcessor>
<AlarmProcessor>
<IP>100.100.100.101</IP>
</AlarmProcessor>
</ArrayOfAlarmProcessor>
Class Code============================================== ====
Namespace MyCompany
Public Class AlarmProcessors
Implements ICollection
Private processorIPList As ArrayList = New ArrayList
Public Sub New()
End Sub
Default Public Overloads ReadOnly Property Item(ByVal index As Integer) As AlarmProcessor
Get
Return CType(processorIPList(index), AlarmProcessor)
End Get
End Property
'Code removed for brevity
End Class
End Namespace
Namespace MyCompany
<Serializable(), Xml.Serialization.XmlRoot("Processor")> _
Public Class AlarmProcessor
Private _IP As String
Public Sub New()
End Sub
<Xml.Serialization.XmlElement("IP")> _
Public Property IP() As String
Get
Return Me._IP
End Get
Set(ByVal Value As String)
Me._IP = Value
End Set
End Property
End Class
End Namespace
Any help would be appreciated!
Thanks,
David
=====================
David McCarter
www.vsdntips.com