RESTful WCF returns 400 Bad Request and more

Client will get a 400 Bad Request response when the return type from the method signature does not match the type of the returned result.

For example,

public Object DoWork()


return 12;



Why IEnumerable<T> cannot be used as the return type?

Because IEnumerable (and other interfaces) are not expressible in XML schema. Using a concrete type works fine in this case.

posted @ 2011-12-07 10:51  光阴四溅  阅读(1233)  评论(0编辑  收藏  举报