Ejemplo n.º 1
0
            public RestResponse recv_execute()
            {
                TMessage msg = iprot_.ReadMessageBegin();

                if (msg.Type == TMessageType.Exception)
                {
                    TApplicationException x = TApplicationException.Read(iprot_);
                    iprot_.ReadMessageEnd();
                    throw x;
                }
                var result = new execute_result();

                result.Read(iprot_);
                iprot_.ReadMessageEnd();
                if (result.__isset.success)
                {
                    return(result.Success);
                }
                throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "execute failed: unknown result");
            }
Ejemplo n.º 2
0
			public bool Process(TProtocol iprot, TProtocol oprot)
			{
				try
				{
					TMessage msg = iprot.ReadMessageBegin();
					ProcessFunction fn;
					processMap_.TryGetValue(msg.Name, out fn);
					if (fn == null)
					{
						TProtocolUtil.Skip(iprot, TType.Struct);
						iprot.ReadMessageEnd();
						var x = new TApplicationException(TApplicationException.ExceptionType.UnknownMethod,
						                                  "Invalid method name: '" + msg.Name + "'");
						oprot.WriteMessageBegin(new TMessage(msg.Name, TMessageType.Exception, msg.SeqID));
						x.Write(oprot);
						oprot.WriteMessageEnd();
						oprot.Transport.Flush();
						return true;
					}
					fn(msg.SeqID, iprot, oprot);
				}
				catch (IOException)
				{
					return false;
				}
				return true;
			}