Monday, December 17, 2007

Returning an array of objects from a Web Service

I am writing an application for Windows CE 4.2 .NET using the .NET Compact Framework. It needs to interact with an Oracle DB, so I am using a web service to perform the DB operations. Among other things my application needs to obtain a set of objects from the web service and for that purpose I didn't want to use DataSets, as I know it's not a good practice. So I thought that it was better to return an ArrayList. Big mistake.

What I had to use is an Array of objects. This link describes the different .NET data types that can be returned from a Web Service. This other link shows some sample code. Don't forget that in order to add new elements to an array you have to use the Array.SetValue() method.

Labels: , ,

0 Comments:

Post a Comment

<< Home