Wednesday, May 26, 2004 03:22 PM
There are sort of two questions floating around here...
First, if you are writing some generic utility class that will return a result set from a query, consider returning a List of Maps. Each Map maps column names to values. This is not necessarily the most efficient thing to do, but it simple and straightforward.
You can try to expose such a method as a web service, using Axis, though I think it will be some work to get the desired effect. It's a complex topic but basically that "List of Maps" data type is going to get lost in the translation... what would the WSDL look like, and what would a .NET client do with that?
If you are exposing a web service, it should really expose more concrete data types. For example you might return some particular "WidgetInfo" object with an Integer property, and 3 String properties, from some web service. That's more the sort of thing that web services / Axis are for... these "translate" much better.