Esempio n. 1
0
        static void Main(string[] args)
        {
            using (var factory = new System.ServiceModel.ChannelFactory<IInventoryService>("IInventoryService"))
            {
                factory.Faulted += Handle_Fault;
                var client = factory.CreateChannel();

                Console.WriteLine("Connected to the queue.  Type in a product name to submit an order or type 'q' + <ENTER> to quit...");
                string productName = Console.ReadLine();
                while (productName != "q")
                {
                    var req = new OrderRequest { Product = productName };
                    client.SubmitOrder(req);
                    Console.WriteLine("Order for product '{0}' submitted...", productName);
                    productName = Console.ReadLine();
                }
            }
        }
Esempio n. 2
0
 public void SubmitOrder(OrderRequest request)
 {
     string productName = request.Product;
     Console.WriteLine("Order recieved for product name '{0}'", productName);
 }