static void Main(string[] args) { Console.WriteLine("starting sample runner"); using (var scope = new TraceContextScope("Пример", TraceContextMode.New)) { //Childs = new List<Process>() { //Process.Start(nameof(EchoApp)) //, Process.Start(nameof(HelloApp))}; AppDomain.CurrentDomain.ProcessExit += CurrentDomain_ProcessExit; AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException; Console.WriteLine("wait..."); Thread.Sleep(TimeSpan.FromSeconds(2)); using (var echo = new EchoClient()) echo.Echo("Hello"); using (var hello = new HelloClient()) hello.Hello(); var txt = scope.Root.ToString(); } Console.WriteLine("Press any key to exit..."); Console.ReadKey(); }
public void Run() { HelloClient client = new HelloClient("Service1OverRabbit"); Console.WriteLine("Client Saying Hello..."); Console.WriteLine(client.Hello("Bob")); client.ChannelFactory.Close(); }
static void Main(string[] args) { Console.Title = "Hello Service Client"; Console.ForegroundColor = ConsoleColor.White; Console.WriteLine("Hello Service Client"); Console.ForegroundColor = ConsoleColor.Gray; Console.WriteLine(); // create a client using the configuration file App.config var client = new HelloClient("HelloService"); Console.WriteLine("Client Saying Hello to Qpid"); client.Hello("Qpid"); Console.WriteLine("Client Saying Hello to AMQP"); client.Hello("AMQP"); // closing the client service client.ChannelFactory.Close(); Console.WriteLine(); Console.Write("Press Enter to Exit..."); Console.ReadLine(); }
static void Main() { // Create a client. HelloClient client = new HelloClient(); // Add a reference-parameter header to the address. // Since the EndpointAddress class is immutable, we must use // EndpointAddressBuilder to change the value. EndpointAddressBuilder builder = new EndpointAddressBuilder(client.Endpoint.Address); AddressHeader header = AddressHeader.CreateAddressHeader(IDName, IDNamespace, "John"); builder.Headers.Add(header); client.Endpoint.Address = builder.ToEndpointAddress(); // Call the Hello service operation. Console.WriteLine(client.Hello()); //Closing the client gracefully closes the connection and cleans up resources client.Close(); Console.WriteLine(); Console.WriteLine("Press <ENTER> to terminate client."); Console.ReadLine(); }
static void Main() { // Create a client. HelloClient client = new HelloClient(); // Add a reference-parameter header to the address. // Since the EndpointAddress class is immutable, we must use // EndpointAddressBuilder to change the value. EndpointAddressBuilder builder = new EndpointAddressBuilder(client.Endpoint.Address); AddressHeader header = AddressHeader.CreateAddressHeader(IDName, IDNamespace, "John"); builder.Headers.Add(header); client.Endpoint.Address = builder.ToEndpointAddress(); // Call the Hello service operation. Console.WriteLine(client.Hello()); //Closing the client gracefully closes the connection and cleans up resources client.Close(); Console.WriteLine(); Console.WriteLine("Press <ENTER> to terminate client."); Console.ReadLine(); }