Exemplo n.º 1
0
            public void Search_Process(int seqid, TProtocol iprot, TProtocol oprot)
            {
                Search_args args = new Search_args();

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

                try
                {
                    result.Success = iface_.Search(args.Name);
                    oprot.WriteMessageBegin(new TMessage("Search", 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("Search", TMessageType.Exception, seqid));
                    x.Write(oprot);
                }
                oprot.WriteMessageEnd();
                oprot.Transport.Flush();
            }
Exemplo n.º 2
0
        public void Search_Process(int seqid, TProtocol iprot, TProtocol oprot)
        {
            Search_args args = new Search_args();

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

            try {
                result.Success = iface_.Search(args.Request);
            } catch (InvalidOperation ex) {
                result.Ex = ex;
            }
            oprot.WriteMessageBegin(new TMessage("Search", TMessageType.Reply, seqid));
            result.Write(oprot);
            oprot.WriteMessageEnd();
            oprot.Transport.Flush();
        }