1

I have small JSON WCF service. Few days ago I decided to change something in one of my functions, and along with other changes I've changed the return type of the function from

ListJSONResponse<MyClass>

to

ListJSONResponse<Object>

in hope that I could return anonymous objects. Unfortunately, after I did that I couldn't get response from my service - I always get HTTP Error 101: The connection was reset.

I've also tried just changing return type and leaving the rest of the function in it's "original" state. Unfortunately the same error happens so I'm pretty sure that using Object in return type is causing the error.

Any ideas what can I do to fix it?

xx77aBs
  • 4,678
  • 9
  • 53
  • 77
  • 1
    Its not working because serialization is failing. See http://stackoverflow.com/questions/2307173/passing-an-instance-of-anonymous-type-over-wcf Further to this, its advisable not to return `Object` from a WCF service - altho giving the impression of 'flexibility' you have no idea what this service returns. – wal Feb 02 '13 at 22:18
  • @wal: Thanks for the link! I'll then create new datatype and use it instead of anonymous object. – xx77aBs Feb 03 '13 at 12:05

0 Answers0