Reputation: 71
What are the datatypes that can be returned by webservices and web methods?
Upvotes: 1
Views: 993
Reputation: 161791
Exactly which types can be returned depends on whether you're using WCF or the legacy ASMX web services.
In either case, you should never return a platform-specific type (like DataReader or DataSet). Even if it's physically possible to do it, it's a bad idea. Even if today, your service will only be called by .NET code, tomorrow it may need to be called by Java or something else you cannot anticipate. Naturally, Java won't know what to do with a type that is specific to the .NET Framework!
Upvotes: 1
Reputation: 739
Web services can return pretty much any serializable data type. It does it by returning the data in XML in the form of a SOAP message. What are you trying to acheive?
Upvotes: 1