views:

39

answers:

2

What are the possible datatypes that can be return from asp.net webservice.

A: 

All primitives including String can be returned with no special code requried. Otherwise you must use data contracts (if you are using WCF) or more powerful XML serialization API.

Strelok
Can a HashTable be returned from asmx webservice
+1  A: 

If you mean asmx, then:

  • pretty much any of the inbuilt primitives and standard data types
  • Stream / byte[]
  • arrays, or lists / collections with obvious semantics
  • xml-serializable types:
    • public types with public parameterless constructors and public properties/fields (optionally attributed for more control)
    • public types that implement IXmlSerializable

For WCF, add data-contracts to that list.

Marc Gravell