Пример #1
0
            public void send_MealPrepared(string OrderID, string DishID, int Quantity, string BakerID)
      #endif
            {
                oprot_.WriteMessageBegin(new TMessage("MealPrepared", TMessageType.Call, seqid_));
                MealPrepared_args args = new MealPrepared_args();

                args.OrderID  = OrderID;
                args.DishID   = DishID;
                args.Quantity = Quantity;
                args.BakerID  = BakerID;
                args.Write(oprot_);
                oprot_.WriteMessageEnd();
        #if SILVERLIGHT
                return(oprot_.Transport.BeginFlush(callback, state));
        #else
                oprot_.Transport.Flush();
        #endif
            }
Пример #2
0
            public void MealPrepared_Process(int seqid, TProtocol iprot, TProtocol oprot)
            {
                MealPrepared_args args = new MealPrepared_args();

                args.Read(iprot);
                iprot.ReadMessageEnd();
                MealPrepared_result result = new MealPrepared_result();

                try
                {
                    try
                    {
                        iface_.MealPrepared(args.OrderID, args.DishID, args.Quantity, args.BakerID);
                    }
                    catch (EPizzeria error)
                    {
                        result.Error = error;
                    }
                    oprot.WriteMessageBegin(new TMessage("MealPrepared", TMessageType.Reply, seqid));
                    result.Write(oprot);
                }
                catch (TTransportException)
                {
                    throw;
                }
                catch (Exception ex)
                {
                    Console.Error.WriteLine("Error occurred in processor:");
                    Console.Error.WriteLine(ex.ToString());
                    TApplicationException x = new TApplicationException(TApplicationException.ExceptionType.InternalError, " Internal error.");
                    oprot.WriteMessageBegin(new TMessage("MealPrepared", TMessageType.Exception, seqid));
                    x.Write(oprot);
                }
                oprot.WriteMessageEnd();
                oprot.Transport.Flush();
            }