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 ?
views:
24answers:
2
Q:
What list of values type should I use for an asmx webservice to be consumed by non .net clients ?
+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
2010-09-19 20:21:04
+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
2010-09-19 20:25:42
I don't know wcf yet seems more complex learning curve than asmx but will look at it.
2010-09-20 19:53:05