I am using the WCF service in my application. I need to return a custom object to a service class. The method is as follows:
IService.cs: [OperationContract] object GetObject(); Service.cs public object GetObject() { object NewObject = "Test"; return NewObject; }
Whenever I call the service, it throws an exception with the following message:
System.ServiceModel.CommunicationException: "An error occured while receiving the HTTP response to <service path>"
Internal exception:
System.Net.WebException: "The underlying connection was closed. An unexpected error occured on receive"
Can't return object types or custom objects from the WCF service?
wcf
Blessy antony
source share