I have a WCF service. I can return a concrete class without a problem, but returning a reference to an interface causes the following issue.
CommunicationException occurred "The socket connection was aborted. This could be caused by an error processing your message or a receive timeout being exceeded by the remote host, or an underlying network resource issue. Local socket timeout was '00:00:59.2030000'."
This occurs when I try to get an instance of a class from a WCF service:
//create the connection
ChannelFactory<IService> _ChannelFactory = new ChannelFactory<IService>(_EndpointName);
IService _ServiceProxy = _ChannelFactory.CreateChannel();
//communication exception thrown here
ITestInterface okcomputer = _ServiceProxy.GetTest();
IService and ITestInterface have all the normal OperationContract attributes and such. The Service has the attribute: [ServiceBehavior(InstanceContextMode = InstanceContextMode.Single)]
other than that, the classes and interfaces are nothing special.
I feel like there is some special trick to returning a class interface from a WCF interface, otherwise I wouldn't be having this problem.. What's the trick?