Renewing the bounty AGAIN because I really need to know how to get this to work, or a definitive answer about why it won't.
I've added an alternative explanation of the problem here.
Having a hell of a time getting a two-way (IsOneWay = false) WCF client-server to work in .Net 3/3.5.
After the client successfully enrolls with the service, the service's periodic Announcement() calls-back to the enrolled clients. It is now that either the client or the server hangs until the server's SendTimeout, adjusted to 2 seconds, elapses. Then the server side has a timeout exception as follows. Only then does the client user code immediately RECEIVE THE METHOD CALL and attempt to return a value. By then the client's socket is aborted and the WCF stuff fails.
It seems to me that something on the client is hanging it's local WCF queue from processing until the socket times out, but not quite early enough to cancel the local method call. But if the exception below is to be believed, the server is attempting to send an operation to http://schemas.microsoft.com/2005/12/ServiceModel/Addressing/Anonymous (inappropriate!) and is timing out. Maybe that URI is just the "Name" of the remotely connected client as WCF knows to refer to it for the purposes of the error message and it just appears to mean that it's failing to load a URI. I can't tell if the server fails first or the client fails first.
I've tried adding WCF tracing but I'm not getting much more information.
Similar sample code is here, but it must have been too much to digest. I've experimented with varations of that code.
TimeoutException 'This request operation sent to http://schemas.microsoft.com/2005/12/ServiceModel/Addressing/Anonymous did not receive a reply within the configured timeout (00:00:00). The time allotted to this operation may have been a portion of a longer timeout. This may be because the service is still processing the operation or because the service was unable to send a reply message. Please consider increasing the operation timeout (by casting the channel/proxy to IContextChannel and setting the OperationTimeout property) and ensure that the service is able to connect to the client.'
Server stack trace:
at System.ServiceModel.Dispatcher.DuplexChannelBinder.SyncDuplexRequest.WaitForReply(TimeSpan timeout)
at System.ServiceModel.Dispatcher.DuplexChannelBinder.Request(Message message, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
IsOneWay
.IsOneWay
shouldn't be false to allow two-way communication,IsOneWay=true
means that when you call the method wcf starts sending the data and then return out of the function. It dosn't care what happens at the server at all. This means that you won't get timeout, but also that the method needs to be of typevoid
. Also, I have a working example of two-way wcf at home which I can post later today with some explanation. – Europium