private void button1_Click(object sender, EventArgs e) { ChannelFactory <IMyWCFService> factory = new ChannelFactory <IMyWCFService>("BasicHttpBinding_IMyWCFService"); IMyWCFService proxy = factory.CreateChannel(); MessageBox.Show(proxy.Echo("Hello!")); }
public ClientProxy(string uri) { // Any channel setup code goes here EndpointAddress address = new EndpointAddress(uri); NetTcpBinding binding = new NetTcpBinding(SecurityMode.Transport); binding.TransferMode = TransferMode.Streamed; binding.MaxBufferSize = //whatever binding.MaxReceivedMessageSize = //whatever ... ChannelFactory <IMyWCFService> factory = new ChannelFactory <IMyWCFService>(binding, address); service = factory.CreateChannel(); }
public ServiceFacade() { _clientImplementation = (Settings.Default.UseMockService == true) ? new MockWCFServiceClient() : new MyWcfServiceClient(); }