Quantcast
Viewing all articles
Browse latest Browse all 256

[RESOLVED] WCF Service with callbacks

Hello,

I have used WCF services before, but this is the first time I am dealing with using callbacks to notify connected clients.

The issue I am currently having is that I can get the clients to connect once and the callback writes to all open clients, but after I close them the service doesn't work. It throws the following exception:

"The communication object, System.ServiceModel.Channels.ServiceChannel, cannot be used for communication because it is in the Faulted state."

I am using the following code to execute:

Code:


var service = new service.serviceClient(new InstanceContext(new MessageCallback()));
           

service.Open();

service.SendMessage(new service.Message() { Message=service.Commands.Start, Parameters = null });

Console.ReadLine();
service.Close();

Like I said, it executes fine the first time but it throws the error after that. I have tried using "service.Abort()" but that didn't make a difference as well as trying to check to the error, but it still throws.

Viewing all articles
Browse latest Browse all 256

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>