开发者

What list of values type should I use for an asmx webservice to be consumed by non .net clients?

开发者 https://www.devze.com 2023-01-16 23:20 出处:网络
I want to create an asmx webservice that would return a list of companies for example but that will be consume开发者_StackOverflow社区d by non .net clients so what return type should I use ?Every 1-di

I want to create an asmx webservice that would return a list of companies for example but that will be consume开发者_StackOverflow社区d by non .net clients so what return type should I use ?


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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号