private static void Main() { try { CallbackType callbackType = new CallbackType(); InstanceContext instanceContext = new InstanceContext(callbackType); HelloIndigoContractClient client = new HelloIndigoContractClient(instanceContext); const string message = "Hello world!"; Console.WriteLine("Send message \"{0}\" to server.", message); Console.WriteLine("Client started on thread {0}", Thread.CurrentThread.GetHashCode()); Console.WriteLine(); client.HelloIndigo(message); } catch (Exception ex) { while (ex != null) { Console.WriteLine(ex.Message); ex = ex.InnerException; } } Console.ReadLine(); }
public Form1() { InitializeComponent(); StartPosition = FormStartPosition.CenterScreen; InstanceContext instanceContext = new InstanceContext(this); client = new HelloIndigoContractClient(instanceContext); WSDualHttpBinding binding = client.Endpoint.Binding as WSDualHttpBinding; if (binding != null) { binding.ClientBaseAddress = new Uri("http://localhost:8101"); } }
public Form1() { InitializeComponent(); this.Text = string.Format("Callback Client - Thread {0}", Thread.CurrentThread.GetHashCode()); InstanceContext context = new InstanceContext(this); m_proxy = new HelloIndigoContractClient(context); WSDualHttpBinding binding = m_proxy.Endpoint.Binding as WSDualHttpBinding; if (binding != null) { binding.ClientBaseAddress = new Uri("http://localhost:8101"); } }
static void Main(string[] args) { Console.WriteLine("Client running on thread {0}", Thread.CurrentThread.GetHashCode()); Console.WriteLine(); CallbackType cb = new CallbackType(); InstanceContext context = new InstanceContext(cb); using (HelloIndigoContractClient proxy = new HelloIndigoContractClient(context)) { Console.WriteLine("Calling HelloIndigo()"); proxy.HelloIndigo("Hello from Client."); Console.WriteLine("Returned from HelloIndigo()"); Console.ReadLine(); } }