9.6. Handling Object Arrays
Chapter 2 covered XML serialization and showed you examples of serializing custom objects and arrays to XML. In this section, we'll take it one step further and build a Web method that returns an array of objects. Then we'll build a client that calls this method and binds a data grid to the returned array.
Listing 9.21 shows a Customer class that has two properties: CompanyName and CustomerID.
Listing 9.21. An example Customer class (VBWSBook\Chapter9\Customer.vb)
<XmlType([Namespace]:= _ "http://www.LearnXmlWS.com/customerorders/")> _ Public Class Customer Private mCompanyName As String Private mCustomerID As String <XmlAttributeAttribute()> _ Public Property CompanyName() As String Get Return mCompanyName End Get ... |
Get Real World XML Web Services: For VB and VB .NET Developers now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.