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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.