views:

24

answers:

2

I want to create an asmx webservice that would return a list of companies for example but that will be consumed by non .net clients so what return type should I use ?

+1  A: 

What about serializing your work objects and returning them directly as plain XML or JSON? In that case, it pretty much doesn't matter what object type you use, since the defined format is not tied to a specific language/framework.

Dennis Delimarsky
+1  A: 

Every 1-dimensional XML-serializable collection type will be serialized to an xs:sequence in the WSDL, so it doesn't really matter which type you use. List<T> and T[] (array) are the two most common.

If you really want interop, though, you'd be wise to stay away from legacy ASMX and use WCF instead. It's much easier to create POX or JSON services/methods using WCF, and those protocols/formats are more widely accessible than SOAP.

Aaronaught
I don't know wcf yet seems more complex learning curve than asmx but will look at it.