static void Main(string[] args) { InstanceContext instance = new InstanceContext(new EchoableCallbackHandler()); EchoableClient client = new EchoableClient(instance); client.Echo("Hello"); Console.ReadLine(); //Closing the client gracefully closes the connection and cleans up resources client.Close(); }
static void Main(string[] args) { EchoableClient client = new EchoableClient(); try { string response = client.Echo("Hello"); Console.WriteLine("Client: Got {0} in response", response); } catch (FaultException <WorkflowAborted> ex) { Console.WriteLine("Client: Got {0} as a fault", ex.Detail.Message); } //Closing the client gracefully closes the connection and cleans up resources client.Close(); Console.WriteLine(); Console.WriteLine("Press <ENTER> to terminate client."); Console.ReadLine(); }