Can my webmethod only return strings like I see in all the asp.net site examples?
+10
A:
asp.net Webmethods can return any serializable data type.
Stephen Wrighton
2008-11-11 20:03:08
A:
As far as I know, you can pretty much return any .NET class, including anonymous types. I've returned custom objects representing my business entities, including generic collections of children entities. Guids, ints, strings, etc. Anything that can be serialized into a string basically.
EvilSyn
2008-11-11 20:03:35
A:
Assuming that this question is about the legacy ASMX web service technology, see Data Types Supported by XML Web Services Created Using ASP.NET.
Be sure to take note of where it says:
This topic is specific to a legacy technology. XML Web services and XML Web service clients should now be created using Windows Communication Foundation (WCF).
John Saunders
2009-07-31 01:18:07