public void GetUser_Process(int seqid, TProtocol iprot, TProtocol oprot) { GetUser_args args = new GetUser_args(); args.Read(iprot); iprot.ReadMessageEnd(); GetUser_result result = new GetUser_result(); try { result.Success = iface_.GetUser(args.UserID.Value); oprot.WriteMessageBegin(new TMessage("GetUser", 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("GetUser", TMessageType.Exception, seqid)); x.Write(oprot); } oprot.WriteMessageEnd(); oprot.Transport.Flush(); }
public void GetUser_Process(int seqid, TProtocol iprot, TProtocol oprot) { GetUser_args args = new GetUser_args(); args.Read(iprot); iprot.ReadMessageEnd(); GetUser_result result = new GetUser_result(); try { result.Success = iface_.GetUser(args.UserId); } catch (IllegalityUserIdException ex) { result.Ex = ex; } oprot.WriteMessageBegin(new TMessage("GetUser", TMessageType.Reply, seqid)); result.Write(oprot); oprot.WriteMessageEnd(); oprot.Transport.Flush(); }
public UserInfo recv_GetUser() { TMessage msg = iprot_.ReadMessageBegin(); if (msg.Type == TMessageType.Exception) { TApplicationException x = TApplicationException.Read(iprot_); iprot_.ReadMessageEnd(); throw x; } GetUser_result result = new GetUser_result(); result.Read(iprot_); iprot_.ReadMessageEnd(); if (result.Success != null) { return(result.Success); } throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "GetUser failed: unknown result"); }
public User recv_GetUser() { TMessage msg = iprot_.ReadMessageBegin(); if (msg.Type == TMessageType.Exception) { TApplicationException x = TApplicationException.Read(iprot_); iprot_.ReadMessageEnd(); throw x; } GetUser_result result = new GetUser_result(); result.Read(iprot_); iprot_.ReadMessageEnd(); if (result.__isset.success) { return result.Success; } if (result.__isset.ex) { throw result.Ex; } throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "GetUser failed: unknown result"); }