diff --git a/compiler/cpp/Makefile b/compiler/cpp/Makefile
index 6b12853..b857e8c 100644
--- a/compiler/cpp/Makefile
+++ b/compiler/cpp/Makefile
@@ -35,9 +35,9 @@
 # Source files
 SRC_FILES = main.cc \
             generate/t_generator.cc \
+            generate/t_java_generator.cc \
             generate/t_php_generator.cc \
-            generate/t_cpp_generator.cc \
-            generate/t_java_generator.cc
+            generate/t_cpp_generator.cc
 
 # Autogenerated files
 GEN_FILES = thrift.tab.hh \
diff --git a/compiler/cpp/src/generate/t_cpp_generator.cc b/compiler/cpp/src/generate/t_cpp_generator.cc
index 43f8021..72132e5 100644
--- a/compiler/cpp/src/generate/t_cpp_generator.cc
+++ b/compiler/cpp/src/generate/t_cpp_generator.cc
@@ -667,15 +667,10 @@
         f_service_ <<
           indent() << "throw facebook::thrift::Exception(\"Unexpected message type, name, or id\");" << endl;
       indent_down();
-      f_service_ <<
-        indent() << "}" << endl;
 
       f_service_ <<
-        endl <<
-        indent() << resultname << " __result;" << endl;
-
-      // Add a field to the return struct if non void
-      f_service_ <<
+        indent() << "}" << endl <<
+        indent() << resultname << " __result;" << endl <<
         indent() << "read_struct_" << resultname << "(_iprot, _itrans, __result);" << endl <<
         indent() << "_iprot->readMessageEnd(_itrans);" << endl <<
         endl;
@@ -727,21 +722,21 @@
 
   // Generate the header portion
   f_header_ <<
-    "class " << service_name_ << "ServerIf : " <<
+    "class " << service_name_ << "Server : " <<
     "public " << service_name_ << "If, " <<
     "public facebook::thrift::TProcessor {" << endl <<
     " public: " << endl;
   indent_up();
   f_header_ << 
     indent() <<
-    service_name_ << "ServerIf(boost::shared_ptr<const facebook::thrift::protocol::TProtocol> protocol) : " <<
+    service_name_ << "Server(boost::shared_ptr<const facebook::thrift::protocol::TProtocol> protocol) : " <<
                        "_iprot(protocol), _oprot(protocol) {}" << endl <<
     indent() <<
-    service_name_ << "ServerIf(boost::shared_ptr<const facebook::thrift::protocol::TProtocol> iprot, boost::shared_ptr<const facebook::thrift::protocol::TProtocol> oprot) : " <<
+    service_name_ << "Server(boost::shared_ptr<const facebook::thrift::protocol::TProtocol> iprot, boost::shared_ptr<const facebook::thrift::protocol::TProtocol> oprot) : " <<
                        "_iprot(iprot), _oprot(oprot) {}" << endl <<
     indent() << "bool process(boost::shared_ptr<facebook::thrift::transport::TTransport> _itrans, " <<
                              "boost::shared_ptr<facebook::thrift::transport::TTransport> _otrans);" << endl <<
-    indent() << "virtual ~" << service_name_ << "ServerIf() {}" << endl;
+    indent() << "virtual ~" << service_name_ << "Server() {}" << endl;
   indent_down();
 
   // Protected data members
@@ -768,7 +763,7 @@
 
   // Generate the server implementation
   f_service_ <<
-    "bool " << service_name_ << "ServerIf::" <<
+    "bool " << service_name_ << "Server::" <<
     "process(boost::shared_ptr<facebook::thrift::transport::TTransport> itrans, boost::shared_ptr<facebook::thrift::transport::TTransport> otrans) {" << endl;
   indent_up();
 
@@ -832,6 +827,10 @@
  * @param tfunction The function
  */
 void t_cpp_generator::generate_function_helpers(t_function* tfunction) {
+  if (tfunction->is_async()) {
+    return;
+  }
+
   t_struct result(tfunction->get_name() + "_result");
   t_field success(tfunction->get_returntype(), "success", 0);
   if (!tfunction->get_returntype()->is_void()) {
@@ -859,7 +858,7 @@
                                                 t_function* tfunction) {
   // Open function
   f_service_ <<
-    "void " << tservice->get_name() << "ServerIf::" <<
+    "void " << tservice->get_name() << "Server::" <<
     "process_" << tfunction->get_name() <<
     "(int32_t seqid, boost::shared_ptr<facebook::thrift::transport::TTransport> itrans, boost::shared_ptr<facebook::thrift::transport::TTransport> otrans)" << endl;
   scope_up(f_service_);
@@ -871,13 +870,19 @@
     indent() << argsname << " __args;" << endl <<
     indent() << "read_struct_" << argsname << "(_iprot, itrans, __args);" << endl <<
     indent() << "_iprot->readMessageEnd(itrans);" << endl <<
-    endl <<
-    indent() << resultname << " __result;" << endl;
- 
+    endl;
+
   t_struct* xs = tfunction->get_xceptions();
   const std::vector<t_field*>& xceptions = xs->get_members();
   vector<t_field*>::const_iterator x_iter;
 
+  // Declare result
+  if (!tfunction->is_async()) {
+    f_service_ <<
+      indent() << resultname << " __result;" << endl;
+  }
+
+  // Try block for functions with exceptions
   if (xceptions.size() > 0) {
     f_service_ <<
       indent() << "try {" << endl;
@@ -890,7 +895,7 @@
   vector<t_field*>::const_iterator f_iter;
 
   f_service_ << indent();
-  if (!tfunction->get_returntype()->is_void()) {
+  if (!tfunction->is_async() && !tfunction->get_returntype()->is_void()) {
     f_service_ << "__result.success = ";    
   }
   f_service_ <<
@@ -907,26 +912,39 @@
   f_service_ << ");" << endl;
 
   // Set isset on success field
-  if (!tfunction->get_returntype()->is_void()) {
+  if (!tfunction->is_async() && !tfunction->get_returntype()->is_void()) {
     f_service_ <<
       indent() << "__result.__isset.success = true;" << endl;
   }
 
-  if (xceptions.size() > 0) {
+  if (!tfunction->is_async() && xceptions.size() > 0) {
     indent_down();
     f_service_ << indent() << "}";
     for (x_iter = xceptions.begin(); x_iter != xceptions.end(); ++x_iter) {
       f_service_ << " catch (" << (*x_iter)->get_type()->get_name() << " &" << (*x_iter)->get_name() << ") {" << endl;
-      indent_up();
-      f_service_ <<
-        indent() << "__result." << (*x_iter)->get_name() << " = " << (*x_iter)->get_name() << ";" << endl <<
-        indent() << "__result.__isset." << (*x_iter)->get_name() << " = true;" << endl;
-      indent_down();
-      f_service_ << indent() << "}";
+      if (!tfunction->is_async()) {
+        indent_up();
+        f_service_ <<
+          indent() << "__result." << (*x_iter)->get_name() << " = " << (*x_iter)->get_name() << ";" << endl <<
+          indent() << "__result.__isset." << (*x_iter)->get_name() << " = true;" << endl;
+        indent_down();
+        f_service_ << indent() << "}";
+      } else {
+        f_service_ << "}";
+      }
     }
     f_service_ << endl;
   }
 
+  // Shortcut out here for async functions
+  if (tfunction->is_async()) {
+    f_service_ <<
+      indent() << "return;" << endl;
+    indent_down();
+    f_service_ << "}" << endl <<
+      endl;
+    return;
+  }
 
   // Serialize the result into a struct
   f_service_ <<
@@ -977,6 +995,9 @@
       case t_base_type::TYPE_STRING:
         f_service_ << "readString(itrans, " << name << ");";
         break;
+      case t_base_type::TYPE_BOOL:
+        f_service_ << "readBool(itrans, " << name << ");";
+        break;
       case t_base_type::TYPE_BYTE:
         f_service_ << "readByte(itrans, " << name << ");";
         break;
@@ -1172,6 +1193,9 @@
       case t_base_type::TYPE_STRING:
         f_service_ << "writeString(otrans, " << name << ");";
         break;
+      case t_base_type::TYPE_BOOL:
+        f_service_ << "writeBool(otrans, " << name << ");";
+        break;
       case t_base_type::TYPE_BYTE:
         f_service_ << "writeByte(otrans, " << name << ");";
         break;
@@ -1378,6 +1402,8 @@
     return "void";
   case t_base_type::TYPE_STRING:
     return "std::string";
+  case t_base_type::TYPE_BOOL:
+    return "bool";
   case t_base_type::TYPE_BYTE:
     return "int8_t";
   case t_base_type::TYPE_I16:
@@ -1413,6 +1439,9 @@
       case t_base_type::TYPE_STRING:
         result += " = \"\"";
         break;
+      case t_base_type::TYPE_BOOL:
+        result += " = false";
+        break;
       case t_base_type::TYPE_BYTE:
       case t_base_type::TYPE_I16:
       case t_base_type::TYPE_I32:
@@ -1478,6 +1507,8 @@
       throw "NO T_VOID CONSTRUCT";
     case t_base_type::TYPE_STRING:
       return "facebook::thrift::protocol::T_STRING";
+    case t_base_type::TYPE_BOOL:
+      return "facebook::thrift::protocol::T_BOOL";
     case t_base_type::TYPE_BYTE:
       return "facebook::thrift::protocol::T_BYTE";
     case t_base_type::TYPE_I16:
diff --git a/compiler/cpp/src/generate/t_java_generator.cc b/compiler/cpp/src/generate/t_java_generator.cc
index f112407..1b466f7 100644
--- a/compiler/cpp/src/generate/t_java_generator.cc
+++ b/compiler/cpp/src/generate/t_java_generator.cc
@@ -13,6 +13,7 @@
 void t_java_generator::init_generator(t_program* tprogram) {
   // Make output directory
   mkdir(T_JAVA_DIR, S_IREAD | S_IWRITE | S_IEXEC);
+  package_name_ = tprogram->get_namespace();
 }
 
 /**
@@ -20,7 +21,7 @@
  */
 string t_java_generator::java_package() {
   // TODO(mcslee): Allow destination package to be specified in .thrift file
-  return string("package ") + program_name_ + ";\n\n";
+  return string("package ") + package_name_ + ";\n\n";
 }
 
 /**
@@ -32,8 +33,7 @@
     "import java.util.ArrayList;\n" +
     "import java.util.HashMap;\n" +
     "import java.util.HashSet;\n" +
-    "import com.facebook.thrift.*;\n" +
-    "import com.facebook.thrift.protocol.TString;\n\n";
+    "import com.facebook.thrift.*;\n\n";
 }
 
 /**
@@ -104,6 +104,15 @@
  * @param tstruct The struct definition
  */
 void t_java_generator::generate_struct(t_struct* tstruct) {
+  generate_java_struct(tstruct, false);
+}
+
+void t_java_generator::generate_xception(t_struct* txception) {
+  generate_java_struct(txception, true);
+}
+
+void t_java_generator::generate_java_struct(t_struct* tstruct,
+                                            bool is_exception) {
   // Make output file
   string f_struct_name = string(T_JAVA_DIR)+"/"+(tstruct->get_name())+".java";
   ofstream f_struct;
@@ -112,23 +121,239 @@
   f_struct <<
     autogen_comment() <<
     java_package() <<
-    java_type_imports();
+    java_type_imports() <<
+    java_thrift_imports();
 
-  f_struct <<
-    "public class " << tstruct->get_name() << " ";
+  generate_java_struct_definition(f_struct,
+                                  tstruct,
+                                  is_exception);
+  f_struct.close();
+}
+
+void t_java_generator::generate_java_struct_definition(ofstream &out,
+                                                       t_struct* tstruct,
+                                                       bool is_exception,
+                                                       bool in_class,
+                                                       bool is_result) {
+  out <<
+    "public " << (in_class ? "static " : "") << "class " << tstruct->get_name() << " ";
   
-  scope_up(f_struct);
+  if (is_exception) {
+    out << "extends Exception ";
+  }
+  
+  scope_up(out);
 
   const vector<t_field*>& members = tstruct->get_members();
   vector<t_field*>::const_iterator m_iter; 
   for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-    indent(f_struct) <<
+    indent(out) <<
       "public " << declare_field(*m_iter, true) << endl;
   }
+
+  if (members.size() > 0) {
+    out <<
+      endl <<
+      indent() << "Isset __isset = new Isset();" << endl <<
+      indent() << "public final class Isset {" << endl;
+    indent_up();
+      for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
+        indent(out) <<
+          "public boolean " << (*m_iter)->get_name() << " = false;" <<  endl;
+      }
+    indent_down();
+    out <<
+      indent() << "}" << endl <<
+      endl;
+  }
   
-  scope_down(f_struct);
+  generate_java_struct_reader(out, tstruct);
+  if (is_result) {
+    generate_java_struct_result_writer(out, tstruct);
+  } else {
+    generate_java_struct_writer(out, tstruct);
+  }
+  scope_down(out);
 }
 
+void t_java_generator::generate_java_struct_reader(ofstream& out,
+                                                   t_struct* tstruct) {
+  out <<
+    indent() << "public static " << tstruct->get_name() << " read(TProtocol _iprot, TTransport _itrans) throws TException {" << endl;
+  indent_up();
+
+  const vector<t_field*>& fields = tstruct->get_members();
+  vector<t_field*>::const_iterator f_iter;
+
+  // Declare stack tmp variables
+  out <<
+    indent() << tstruct->get_name() << " _value = new " << tstruct->get_name() << "();" << endl <<
+    indent() << "TField _field;" << endl <<
+    indent() << "TStruct _struct = _iprot.readStructBegin(_itrans);" << endl;
+  
+  // Loop over reading in fields
+  indent(out) <<
+    "while (true)" << endl;
+
+    scope_up(out);
+    
+    // Read beginning field marker
+    indent(out) <<
+      "_field = _iprot.readFieldBegin(_itrans);" << endl;
+    
+    // Check for field STOP marker and break
+    indent(out) <<
+      "if (_field.type == TType.STOP) { " << endl;
+    indent_up();
+    indent(out) <<
+      "break;" << endl;
+    indent_down();
+    indent(out) <<
+      "}" << endl;
+    
+    // Switch statement on the field we are reading
+    indent(out) <<
+      "switch (_field.id)" << endl;
+
+      scope_up(out);
+    
+      // Generate deserialization code for known cases
+      for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
+        indent(out) <<
+          "case " << (*f_iter)->get_key() << ":" << endl;
+        indent_up();
+        generate_deserialize_field(out, *f_iter, "_value.");
+        out <<
+          indent() << "_value.__isset." << (*f_iter)->get_name() << " = true;" << endl;
+        indent(out) <<
+          "break;" << endl;
+        indent_down();
+      }
+      
+      // In the default case we skip the field
+      out <<
+        indent() << "default:" << endl <<
+        indent() << "  TProtocolUtil.skip(_iprot, _itrans, _field.type);" << endl <<
+        indent() << "  break;" << endl;
+      
+      scope_down(out);
+
+    // Read field end marker
+    indent(out) <<
+      "_iprot.readFieldEnd(_itrans);" << endl;
+    
+    scope_down(out);
+      
+    out <<
+      indent() << "_iprot.readStructEnd(_itrans);" << endl <<
+      indent() << "return _value;" << endl; 
+
+  indent_down();
+  out <<
+    indent() << "}" << endl <<
+    endl;
+}
+
+void t_java_generator::generate_java_struct_writer(ofstream& out,
+                                                   t_struct* tstruct) {
+  out <<
+    indent() << "public void write(TProtocol _oprot, TTransport _otrans) throws TException {" << endl;
+  indent_up();
+
+  string name = tstruct->get_name();
+  const vector<t_field*>& fields = tstruct->get_members();
+  vector<t_field*>::const_iterator f_iter;
+
+  out <<
+    indent() << "TStruct _struct = new TStruct(\"" << name << "\");" << endl <<
+    indent() << "TField _field = new TField();" << endl <<
+    indent() << "_oprot.writeStructBegin(_otrans, _struct);" << endl;
+
+  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
+    out <<
+      indent() << "_field.name = \"" << (*f_iter)->get_name() << "\";" << endl <<
+      indent() << "_field.type = " << type_to_enum((*f_iter)->get_type()) << ";" << endl <<
+      indent() << "_field.id = " << (*f_iter)->get_key() << ";" << endl <<
+      indent() << "_oprot.writeFieldBegin(_otrans, _field);" << endl;
+
+    // Write field contents
+    generate_serialize_field(out, *f_iter, "this.");
+
+    // Write field closer
+    indent(out) <<
+      "_oprot.writeFieldEnd(_otrans);" << endl;
+  }
+  // Write the struct map
+  out <<
+    indent() << "_oprot.writeFieldStop(_otrans);" << endl <<
+    indent() << "_oprot.writeStructEnd(_otrans);" << endl;
+
+  indent_down();
+  out <<
+    indent() << "}" << endl <<
+    endl;
+}
+
+void t_java_generator::generate_java_struct_result_writer(ofstream& out,
+                                                          t_struct* tstruct) {
+  out <<
+    indent() << "public void write(TProtocol _oprot, TTransport _otrans) throws TException {" << endl;
+  indent_up();
+
+  string name = tstruct->get_name();
+  const vector<t_field*>& fields = tstruct->get_members();
+  vector<t_field*>::const_iterator f_iter;
+
+  out <<
+    indent() << "TStruct _struct = new TStruct(\"" << name << "\");" << endl <<
+    indent() << "TField _field = new TField();" << endl <<
+    indent() << "_oprot.writeStructBegin(_otrans, _struct);" << endl;
+
+  bool first = true;
+  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
+    if (first) {
+      first = false;
+      out <<
+        endl <<
+        indent() << "if ";
+    } else {
+      out <<
+        " else if ";
+    }
+
+    out <<
+      "(this.__isset." << (*f_iter)->get_name() << ") {" << endl;
+    indent_up();
+
+    out <<
+      indent() << "_field.name = \"" << (*f_iter)->get_name() << "\";" << endl <<
+      indent() << "_field.type = " << type_to_enum((*f_iter)->get_type()) << ";" << endl <<
+      indent() << "_field.id = " << (*f_iter)->get_key() << ";" << endl <<
+      indent() << "_oprot.writeFieldBegin(_otrans, _field);" << endl;
+
+    // Write field contents
+    generate_serialize_field(out, *f_iter, "this.");
+
+    // Write field closer
+    indent(out) <<
+      "_oprot.writeFieldEnd(_otrans);" << endl;
+
+    indent_down();
+    indent(out) << "}";
+  }
+  // Write the struct map
+  out <<
+    endl <<
+    indent() << "_oprot.writeFieldStop(_otrans);" << endl <<
+    indent() << "_oprot.writeStructEnd(_otrans);" << endl;
+
+  indent_down();
+  out <<
+    indent() << "}" << endl <<
+    endl;
+}
+
+
 /**
  * Generates a thrift service. In C++, this comprises an entirely separate
  * header and source file. The header file defines the methods and includes
@@ -138,52 +363,9 @@
  * @param tservice The service definition
  */
 void t_java_generator::generate_service(t_service* tservice) {
-  // Generate the three main parts of the service
-  generate_service_interface(tservice);
-  generate_service_server(tservice);
-  generate_service_client(tservice);
-}
-
-/**
- * Generates a service interface definition.
- *
- * @param tservice The service to generate a header definition for
- */
-void t_java_generator::generate_service_interface(t_service* tservice) {
   // Make output file
-  string f_interface_name = string(T_JAVA_DIR)+"/"+service_name_+"If.java";
-  ofstream f_interface;
-  f_interface.open(f_interface_name.c_str());
-
-  f_interface <<
-    autogen_comment() <<
-    java_package() <<
-    java_type_imports();
-
-  f_interface <<
-    "public abstract class " << service_name_ << "If {" << endl;
-  indent_up();
-  vector<t_function*> functions = tservice->get_functions();
-  vector<t_function*>::iterator f_iter; 
-  for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-    indent(f_interface) <<
-      "public abstract " << function_signature(*f_iter) <<
-      " throws TException;" << endl;
-  }
-  indent_down();
-  f_interface <<
-    "}" << endl;
-  f_interface.close();
-}
-
-/**
- * Generates a service client definition.
- *
- * @param tservice The service to generate a server for.
- */
-void t_java_generator::generate_service_client(t_service* tservice) {
-  string f_client_name = string(T_JAVA_DIR)+"/"+service_name_+"Client.java";
-  f_service_.open(f_client_name.c_str());
+  string f_service_name = string(T_JAVA_DIR)+"/"+service_name_+".java";
+  f_service_.open(f_service_name.c_str());
 
   f_service_ <<
     autogen_comment() <<
@@ -192,13 +374,63 @@
     java_thrift_imports();
 
   f_service_ <<
-    "public class " << service_name_ << "Client " <<
-    "extends " << service_name_ << "If {" << endl;
+    "public class " << service_name_ << " {" << endl <<
+    endl;
+
+  // Generate the three main parts of the service
+  generate_service_interface(tservice);
+  generate_service_client(tservice);
+  generate_service_server(tservice);
+  generate_service_helpers(tservice);
+
+  f_service_ <<
+    "}" << endl;
+  f_service_.close();
+}
+
+/**
+ * Generates a service interface definition.
+ *
+ * @param tservice The service to generate a header definition for
+ */
+void t_java_generator::generate_service_interface(t_service* tservice) {
+  f_service_ <<
+    indent() << "public interface Iface {" << endl;
+  indent_up();
+  vector<t_function*> functions = tservice->get_functions();
+  vector<t_function*>::iterator f_iter; 
+  for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
+    indent(f_service_) <<
+      "public " << function_signature(*f_iter) << ";" << endl;
+  }
+  indent_down();
+  f_service_ <<
+    indent() << "}" << endl <<
+    endl;
+}
+
+void t_java_generator::generate_service_helpers(t_service* tservice) {
+  vector<t_function*> functions = tservice->get_functions();
+  vector<t_function*>::iterator f_iter; 
+  for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
+    t_struct* ts = (*f_iter)->get_arglist();
+    generate_java_struct_definition(f_service_, ts, false, true);
+    generate_function_helpers(*f_iter);
+  }
+}
+
+/**
+ * Generates a service client definition.
+ *
+ * @param tservice The service to generate a server for.
+ */
+void t_java_generator::generate_service_client(t_service* tservice) {
+  f_service_ <<
+    "public static class Client implements Iface {" << endl;
   indent_up();
 
   indent(f_service_) <<
-    "public " << service_name_ << "Client" <<
-    "(TTransport trans, TProtocol prot)" << endl;
+    "public Client(TTransport trans, TProtocol prot)" << endl;
   scope_up(f_service_);
   indent(f_service_) << 
     "this(trans, trans, prot, prot);" << endl;
@@ -206,8 +438,7 @@
   f_service_ << endl;
 
   indent(f_service_) <<
-    "public " << service_name_ << "Client" <<
-    "(TTransport itrans, TTransport otrans," <<
+    "public Client(TTransport itrans, TTransport otrans," <<
     " TProtocol iprot, TProtocol oprot)" << endl;
   scope_up(f_service_);
   f_service_ <<
@@ -222,7 +453,10 @@
     indent() << "private TTransport _itrans;" << endl <<
     indent() << "private TTransport _otrans;" << endl <<
     indent() << "private TProtocol  _iprot;"  << endl <<
-    indent() << "private TProtocol  _oprot;"  << endl << endl;
+    indent() << "private TProtocol  _oprot;"  << endl <<
+    endl <<
+    indent() << "private int _seqid;" << endl <<
+    endl;
 
   // Generate client method implementations
   vector<t_function*> functions = tservice->get_functions();
@@ -232,7 +466,7 @@
 
     // Open function
     indent(f_service_) <<
-      "public " << function_signature(*f_iter) << " throws TException" << endl;
+      "public " << function_signature(*f_iter) << endl;
     scope_up(f_service_);
     indent(f_service_) <<
       "send_" << funname << "(";
@@ -269,74 +503,77 @@
                              string("send_") + (*f_iter)->get_name(),
                              (*f_iter)->get_arglist());
 
+    string argsname = (*f_iter)->get_name() + "_args";
+
     // Open function
     indent(f_service_) <<
-      "public " << function_signature(&send_function) << " throws TException" << endl;
+      "public " << function_signature(&send_function) << endl;
     scope_up(f_service_);
 
     // Serialize the request
     f_service_ <<
-      indent() <<
-      "_oprot.writeStructBegin(_otrans, " <<
-      "new TStruct(\"function\"));" << endl <<
-      indent() <<
-      "_oprot.writeFieldBegin(_otrans, " <<
-      "new TField(\"name\", TType.STRING, 0));" << endl <<
-      indent() <<
-      "_oprot.writeString(_otrans, " <<
-      "\"" << funname << "\");" << endl <<
-      indent() <<
-      "_oprot.writeFieldEnd(_otrans);" << endl <<
-      indent() <<
-      "_oprot.writeFieldBegin(_otrans, " <<
-      "new TField(\"args\", TType.STRUCT, 1));" << endl;
-    generate_serialize_struct((*f_iter)->get_arglist());
+      indent() << "_oprot.writeMessageBegin(_otrans, new TMessage(\"" << funname << "\", TMessageType.CALL, _seqid));" << endl <<
+      indent() << argsname << " __args = new " << argsname << "();" << endl;
+
+    for (fld_iter = fields.begin(); fld_iter != fields.end(); ++fld_iter) {
+      f_service_ <<
+        indent() << "__args." << (*fld_iter)->get_name() << " = " << (*fld_iter)->get_name() << ";" << endl;
+    }
+
     f_service_ <<
-      indent() <<
-      "_oprot.writeFieldEnd(_otrans);" << endl <<
-      indent() <<
-      "_oprot.writeFieldStop(_otrans);" << endl <<
-      indent() <<
-      "_oprot.writeStructEnd(_otrans);" << endl;
-    
-    // Flush the request
-    indent(f_service_) <<
-      "_otrans.flush();" << endl;
+      indent() << "__args.write(_oprot, _otrans);" << endl <<
+      indent() << "_oprot.writeMessageEnd(_otrans);" << endl <<
+      indent() << "_otrans.flush();" << endl;
 
     scope_down(f_service_);
     f_service_ << endl;
 
     if (!(*f_iter)->is_async()) {
+      string resultname = (*f_iter)->get_name() + "_result";
+
       t_struct noargs;
       t_function recv_function((*f_iter)->get_returntype(),
                                string("recv_") + (*f_iter)->get_name(),
-                               &noargs);
+                               &noargs,
+                               (*f_iter)->get_xceptions());
       // Open function
       indent(f_service_) <<
-        "public " << function_signature(&recv_function) << " throws TException" << endl;
+        "public " << function_signature(&recv_function) << endl;
       scope_up(f_service_);
-      
-      // Read the response
-      t_struct result_struct((*f_iter)->get_name() + "_result");
-      t_field result_field((*f_iter)->get_returntype(), "_result");
-      
-      // Add a field to the return struct if non void
-      if (!(*f_iter)->get_returntype()->is_void()) {
-        indent(f_service_) <<
-          declare_field(&result_field, true) << endl;
-        result_struct.append(&result_field);
-      }
-      
-      // Deserialize response struct
-      generate_deserialize_struct(&result_struct);
-      
+           
+      // TODO(mcslee): Message validation here
+
+      f_service_ <<
+        indent() << "TMessage _msg = _iprot.readMessageBegin(_itrans);" << endl <<
+        indent() << resultname << " __result = " << resultname << ".read(_iprot, _itrans);" << endl <<
+        indent() << "_iprot.readMessageEnd(_itrans);" << endl <<
+        endl;
+
       // Careful, only return _result if not a void function
       if (!(*f_iter)->get_returntype()->is_void()) {
-        indent(f_service_) <<
-          "return _result;" << endl;
-      } else {
+        f_service_ <<
+          indent() << "if (__result.__isset.success) {" << endl <<
+          indent() << "  return __result.success;" << endl <<
+          indent() << "}" << endl;
+      }
+
+      t_struct* xs = (*f_iter)->get_xceptions();
+      const std::vector<t_field*>& xceptions = xs->get_members();
+      vector<t_field*>::const_iterator x_iter;
+      for (x_iter = xceptions.begin(); x_iter != xceptions.end(); ++x_iter) {
+        f_service_ <<
+          indent() << "if (__result.__isset." << (*x_iter)->get_name() << ") {" << endl <<
+          indent() << "  throw __result." << (*x_iter)->get_name() << ";" << endl <<
+          indent() << "}" << endl;
+      }
+
+      // Careful, only return _result if not a void function
+      if ((*f_iter)->get_returntype()->is_void()) {
         indent(f_service_) <<
           "return;" << endl;
+      } else {
+        f_service_ <<
+          indent() << "throw new TException(\"" << (*f_iter)->get_name() << " failed: unknown result\");" << endl;
       }
       
       // Close function
@@ -348,7 +585,6 @@
   indent_down();
   f_service_ <<
     "}" << endl;
-  f_service_.close();
 }
 
 /**
@@ -357,28 +593,17 @@
  * @param tservice The service to generate a server for.
  */
 void t_java_generator::generate_service_server(t_service* tservice) {
-  string f_server_name = string(T_JAVA_DIR)+"/"+service_name_+"ServerIf.java";
-  f_service_.open(f_server_name.c_str());
-
-  f_service_ <<
-    autogen_comment() <<
-    java_package() <<
-    java_type_imports() <<
-    java_thrift_imports();
-
   // Generate the dispatch methods
   vector<t_function*> functions = tservice->get_functions();
   vector<t_function*>::iterator f_iter; 
 
   // Generate the header portion
   f_service_ <<
-    "public abstract class " << service_name_ << "ServerIf " <<
-    "extends " << service_name_ << "If implements TProcessor {" << endl;
+    "public abstract static class Server implements Iface, TProcessor {" << endl;
   indent_up();
 
   indent(f_service_) <<
-    "public " << service_name_ << "ServerIf" <<
-    "(TProtocol prot)" << endl;
+    "public Server(TProtocol prot)" << endl;
   scope_up(f_service_);
   indent(f_service_) << 
     "this(prot, prot);" << endl;
@@ -386,8 +611,7 @@
   f_service_ << endl;
 
   indent(f_service_) <<
-    "public " << service_name_ << "ServerIf" <<
-    "(TProtocol iprot, TProtocol oprot)" << endl;
+    "public Server(TProtocol iprot, TProtocol oprot)" << endl;
   scope_up(f_service_);
   f_service_ <<
     indent() << "_iprot = iprot;" << endl <<
@@ -406,22 +630,9 @@
   scope_up(f_service_);
 
   f_service_ <<
-    indent() <<
-    "String _fname;" << endl <<
-    indent() <<
-    "TStruct _struct;" << endl <<
-    indent() <<
-    "TField _field;" << endl <<
-    indent() <<
-    "_struct = _iprot.readStructBegin(_itrans);" << endl <<
-    indent() <<
-    "_field = _iprot.readFieldBegin(_itrans);" << endl <<
-    indent() <<
-    "_fname = _iprot.readString(_itrans);" << endl <<
-    indent() <<
-    "_iprot.readFieldEnd(_itrans);" << endl <<
-    indent() <<
-    "_field = _iprot.readFieldBegin(_itrans);" << endl;
+    indent() << "TMessage _msg = _iprot.readMessageBegin(_itrans);" << endl;
+
+  // TODO(mcslee): validate message
 
   bool first = true;
   for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
@@ -432,11 +643,11 @@
       first = false;
     }
     f_service_ <<
-      "if (_fname.equals(\"" << (*f_iter)->get_name() <<"\")) {" << endl;
+      "if (_msg.name.equals(\"" << (*f_iter)->get_name() <<"\")) {" << endl;
     indent_up();
     indent(f_service_) <<
       "process_" << (*f_iter)->get_name() <<
-      "(_itrans, _otrans);" << endl;
+      "(_msg.seqid, _itrans, _otrans);" << endl;
     indent_down();
     indent(f_service_) << "}";
   }
@@ -445,21 +656,14 @@
   indent_up();
   indent(f_service_) <<
     "System.err.println" <<
-    "(\"Unknown function: '\" + _field.name + \"'\");" << endl;
+    "(\"Unknown function: '\" + _msg.name + \"'\");" << endl;
   indent_down();
   indent(f_service_) <<
     "}" << endl;
-
+  
   // Read end of args field, the T_STOP, and the struct close
   f_service_ <<
-    indent() <<
-    "_iprot.readFieldEnd(_itrans);" << endl <<
-    indent() <<
-    "_field = _iprot.readFieldBegin(_itrans);" << endl <<   
-    indent() <<
-    "_iprot.readStructEnd(_itrans);" << endl <<
-    indent() <<
-    "return true;" << endl;
+    indent() << "return true;" << endl;
 
   scope_down(f_service_);
   f_service_ << endl;
@@ -473,8 +677,32 @@
   f_service_ <<
     "}" << endl <<
     endl;
+}
 
-  f_service_.close();
+/**
+ * Generates a struct and helpers for a function.
+ *
+ * @param tfunction The function
+ */
+void t_java_generator::generate_function_helpers(t_function* tfunction) {
+  if (tfunction->is_async()) {
+    return;
+  }
+
+  t_struct result(tfunction->get_name() + "_result");
+  t_field success(tfunction->get_returntype(), "success", 0);
+  if (!tfunction->get_returntype()->is_void()) {
+    result.append(&success);
+  }
+
+  t_struct* xs = tfunction->get_xceptions();
+  const vector<t_field*>& fields = xs->get_members();
+  vector<t_field*>::const_iterator f_iter;
+  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
+    result.append(*f_iter);
+  }
+
+  generate_java_struct_definition(f_service_, &result, false, true, true);
 }
 
 /**
@@ -487,28 +715,42 @@
   // Open function
   indent(f_service_) <<
     "private void process_" << tfunction->get_name() <<
-    "(TTransport _itrans, TTransport _otrans) throws TException" << endl;
+    "(int seqid, TTransport _itrans, TTransport _otrans) throws TException" << endl;
   scope_up(f_service_);
 
-  // Get the struct of function call params
-  t_struct* arg_struct = tfunction->get_arglist();
+  string argsname = tfunction->get_name() + "_args";
+  string resultname = tfunction->get_name() + "_result";
 
-  // Declare the function arguments
-  const vector<t_field*>& fields = arg_struct->get_members();
-  vector<t_field*>::const_iterator f_iter;
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    indent(f_service_) <<
-      declare_field(*f_iter, true) << endl;
+  f_service_ <<
+    indent() << argsname << " __args = " << argsname << ".read(_iprot, _itrans);" << endl <<
+    indent() << "_iprot.readMessageEnd(_itrans);" << endl;
+
+  t_struct* xs = tfunction->get_xceptions();
+  const std::vector<t_field*>& xceptions = xs->get_members();
+  vector<t_field*>::const_iterator x_iter;
+
+  // Declare result for non async function
+  if (!tfunction->is_async()) {
+    f_service_ <<
+      indent() << resultname << " __result = new " << resultname << "();" << endl <<
+      endl;
   }
 
-  // Deserialize the function arguments as a struct
-  generate_deserialize_struct(arg_struct);
-  
-  // Generate the function call
-  f_service_ << indent();
-  if (!tfunction->get_returntype()->is_void()) {
+  // Try block for a function with exceptions
+  if (xceptions.size() > 0) {
     f_service_ <<
-      type_name(tfunction->get_returntype()) << " _result = ";
+      indent() << "try {" << endl;
+    indent_up();
+  }
+ 
+  // Generate the function call
+  t_struct* arg_struct = tfunction->get_arglist();
+  const std::vector<t_field*>& fields = arg_struct->get_members();
+  vector<t_field*>::const_iterator f_iter;
+
+  f_service_ << indent();
+  if (!tfunction->is_async() && !tfunction->get_returntype()->is_void()) {
+    f_service_ << "__result.success = ";
   }
   f_service_ <<
     tfunction->get_name() << "(";
@@ -519,21 +761,51 @@
     } else {
       f_service_ << ", ";
     }
-    f_service_ << (*f_iter)->get_name();
+    f_service_ << "__args." << (*f_iter)->get_name();
   }
   f_service_ << ");" << endl;
 
-  // Serialize the result into a struct
-  t_struct result_struct(tfunction->get_name() + "_result");
-  t_field result_field(tfunction->get_returntype(), "_result");
-
-  // Only append the field if non-void
-  if (!tfunction->get_returntype()->is_void()) {
-    result_struct.append(&result_field);
+  // Set isset on success field
+  if (!tfunction->is_async() && !tfunction->get_returntype()->is_void()) {
+    f_service_ <<
+      indent() << "__result.__isset.success = true;" << endl;
   }
-  generate_serialize_struct(&result_struct);
-  indent(f_service_) <<
-    "_otrans.flush();" << endl;
+
+  if (!tfunction->is_async() && xceptions.size() > 0) {
+    indent_down();
+    f_service_ << indent() << "}";
+    for (x_iter = xceptions.begin(); x_iter != xceptions.end(); ++x_iter) {
+      f_service_ << " catch (" << (*x_iter)->get_type()->get_name() << " " << (*x_iter)->get_name() << ") {" << endl;
+      if (!tfunction->is_async()) {
+        indent_up();
+        f_service_ <<
+          indent() << "__result." << (*x_iter)->get_name() << " = " << (*x_iter)->get_name() << ";" << endl <<
+          indent() << "__result.__isset." << (*x_iter)->get_name() << " = true;" << endl;
+        indent_down();
+        f_service_ << indent() << "}";
+      } else {
+        f_service_ << "}";
+      }
+    }
+    f_service_ << endl;
+  }
+
+  // Shortcut out here for async functions
+  if (tfunction->is_async()) {
+    f_service_ <<
+      indent() << "return;" << endl;
+    indent_down();
+    f_service_ << "}" << endl <<
+      endl;
+    return;
+  }
+
+  f_service_ <<
+    endl <<
+    indent() << "_oprot.writeMessageBegin(_otrans, new TMessage(\"" << tfunction->get_name() << "\", TMessageType.REPLY, seqid));" << endl <<
+    indent() << "__result.write(_oprot, _otrans);" << endl <<
+    indent() << "_oprot.writeMessageEnd(_otrans);" << endl <<
+    indent() << "_otrans.flush();" << endl;
 
   // Close function
   scope_down(f_service_);
@@ -543,8 +815,9 @@
 /**
  * Deserializes a field of any type.
  */
-void t_java_generator::generate_deserialize_field(t_field* tfield,
-                                                 string prefix) {
+void t_java_generator::generate_deserialize_field(ofstream& out,
+                                                  t_field* tfield,
+                                                  string prefix) {
   t_type* type = tfield->get_type();
   while (type->is_typedef()) {
     type = ((t_typedef*)type)->get_type();
@@ -557,14 +830,15 @@
 
   string name = prefix + tfield->get_name();
 
-  if (type->is_struct()) {
-    generate_deserialize_struct((t_struct*)(tfield->get_type()),
-                                 name + ".");
+  if (type->is_struct() || type->is_xception()) {
+    generate_deserialize_struct(out,
+                                (t_struct*)(tfield->get_type()),
+                                name);
   } else if (type->is_container()) {
-    generate_deserialize_container(tfield->get_type(), name);
+    generate_deserialize_container(out, tfield->get_type(), name);
   } else if (type->is_base_type() || type->is_enum()) {
 
-    indent(f_service_) <<
+    indent(out) <<
       name << " = _iprot.";
     
     if (type->is_base_type()) {
@@ -575,24 +849,30 @@
           name;
         break;
       case t_base_type::TYPE_STRING:        
-        f_service_ << "readString(_itrans);";
+        out << "readString(_itrans);";
+        break;
+      case t_base_type::TYPE_BOOL:
+        out << "readBool(_itrans);";
         break;
       case t_base_type::TYPE_BYTE:
-        f_service_ << "readByte(_itrans);";
+        out << "readByte(_itrans);";
+        break;
+      case t_base_type::TYPE_I16:
+        out << "readI16(_itrans);";
         break;
       case t_base_type::TYPE_I32:
-        f_service_ << "readI32(_itrans);";
+        out << "readI32(_itrans);";
         break;
       case t_base_type::TYPE_I64:
-        f_service_ << "readI64(_itrans);";
+        out << "readI64(_itrans);";
         break;
       default:
-        throw "compiler error: no C++ name for base type " + tbase;
+        throw "compiler error: no Java name for base type " + tbase;
       }
     } else if (type->is_enum()) {
-      f_service_ << "readI32(_itrans);";
+      out << "readI32(_itrans);";
     }
-    f_service_ <<
+    out <<
       endl;
   } else {
     printf("DO NOT KNOW HOW TO DESERIALIZE FIELD '%s' TYPE '%s'\n",
@@ -606,86 +886,17 @@
  * buffer for deserialization, and that there is a variable protocol which
  * is a reference to a TProtocol serialization object.
  */
-void t_java_generator::generate_deserialize_struct(t_struct* tstruct,
-                                                  string prefix) {
-  const vector<t_field*>& fields = tstruct->get_members();
-  vector<t_field*>::const_iterator f_iter;
-
-  scope_up(f_service_);
-
-  // Read the struct fields from the protocol
-  string _struct = tmp("_struct");
-  string _field = tmp("_field");
-  
-  // Declare stack tmp variables
-  f_service_ <<
-    indent() << "TField " << _field << ";" << endl <<
-    indent() << "TStruct " << _struct << " = _iprot.readStructBegin(_itrans);" << endl;
-  
-  // Loop over reading in fields
-  indent(f_service_) <<
-    "while (true)" << endl;
-
-    scope_up(f_service_);
-    
-    // Read beginning field marker
-    indent(f_service_) <<
-      _field << " = _iprot.readFieldBegin(_itrans);" << endl;
-    
-    // Check for field STOP marker and break
-    indent(f_service_) <<
-      "if (" << _field << ".type == TType.STOP) { " << endl;
-    indent_up();
-    indent(f_service_) <<
-      "break;" << endl;
-    indent_down();
-    indent(f_service_) <<
-      "}" << endl;
-    
-    // Switch statement on the field we are reading
-    indent(f_service_) <<
-      "switch ((int)" << _field << ".id)" << endl;
-
-      scope_up(f_service_);
-    
-      // Generate deserialization code for known cases
-      for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-        indent(f_service_) <<
-          "case " << (*f_iter)->get_key() << ":" << endl;
-        indent_up();
-        generate_deserialize_field(*f_iter, prefix);
-        indent(f_service_) <<
-          "break;" << endl;
-        indent_down();
-      }
-      
-      // In the default case we skip the field
-      f_service_ <<
-        indent() <<
-        "default:" << endl <<
-        indent() <<
-        "  TProtocolUtil.skip(_iprot, _itrans, " << 
-        _field << ".type);" << endl <<
-        indent() <<
-        "  break;" << endl;
-      
-      scope_down(f_service_);
-
-    // Read field end marker
-    indent(f_service_) <<
-      "_iprot.readFieldEnd(_itrans);" << endl;
-    
-    scope_down(f_service_);
-      
-  indent(f_service_) <<
-    "_iprot.readStructEnd(_itrans);" << endl;
-
-  scope_down(f_service_);
+void t_java_generator::generate_deserialize_struct(ofstream& out,
+                                                   t_struct* tstruct,
+                                                   string prefix) {
+  out <<
+    indent() << prefix << " = " << tstruct->get_name() << ".read(_iprot, _itrans);" << endl;
 }
 
-void t_java_generator::generate_deserialize_container(t_type* ttype,
-                                                     string prefix) {
-  scope_up(f_service_);
+void t_java_generator::generate_deserialize_container(ofstream& out,
+                                                      t_type* ttype,
+                                                      string prefix) {
+  scope_up(out);
   
   string obj;
 
@@ -699,96 +910,99 @@
 
   // Declare variables, read header
   if (ttype->is_map()) {
-    f_service_ <<
+    out <<
       indent() << "TMap " << obj << " = _iprot.readMapBegin(_itrans);" << endl;
   } else if (ttype->is_set()) {
-    f_service_ <<
+    out <<
       indent() << "TSet " << obj << " = _iprot.readSetBegin(_itrans);" << endl;
   } else if (ttype->is_list()) {
-    f_service_ <<
+    out <<
       indent() << "TList " << obj << " = _iprot.readListBegin(_itrans);" << endl;
   }
 
 
   // For loop iterates over elements
   string i = tmp("_i");
-  indent(f_service_) <<
+  indent(out) <<
     "for (int " << i << " = 0; " <<
     i << " < " << obj << ".size" << "; " <<
     "++" << i << ")" << endl;
   
-    scope_up(f_service_);
+    scope_up(out);
     
     if (ttype->is_map()) {
-      generate_deserialize_map_element((t_map*)ttype, prefix);
+      generate_deserialize_map_element(out, (t_map*)ttype, prefix);
     } else if (ttype->is_set()) {
-      generate_deserialize_set_element((t_set*)ttype, prefix);
+      generate_deserialize_set_element(out, (t_set*)ttype, prefix);
     } else if (ttype->is_list()) {
-      generate_deserialize_list_element((t_list*)ttype, prefix);
+      generate_deserialize_list_element(out, (t_list*)ttype, prefix);
     }
     
-    scope_down(f_service_);
+    scope_down(out);
 
   // Read container end
   if (ttype->is_map()) {
-    indent(f_service_) << "_iprot.readMapEnd(_itrans);" << endl;
+    indent(out) << "_iprot.readMapEnd(_itrans);" << endl;
   } else if (ttype->is_set()) {
-    indent(f_service_) << "_iprot.readSetEnd(_itrans);" << endl;
+    indent(out) << "_iprot.readSetEnd(_itrans);" << endl;
   } else if (ttype->is_list()) {
-    indent(f_service_) << "_iprot.readListEnd(_itrans);" << endl;
+    indent(out) << "_iprot.readListEnd(_itrans);" << endl;
   }
 
-  scope_down(f_service_);
+  scope_down(out);
 }
 
 
 /**
  * Generates code to deserialize a map
  */
-void t_java_generator::generate_deserialize_map_element(t_map* tmap,
+void t_java_generator::generate_deserialize_map_element(ofstream& out,
+                                                        t_map* tmap,
                                                         string prefix) {
   string key = tmp("_key");
   string val = tmp("_val");
   t_field fkey(tmap->get_key_type(), key);
   t_field fval(tmap->get_val_type(), val);
 
-  indent(f_service_) <<
+  indent(out) <<
     declare_field(&fkey, true) << endl;
-  indent(f_service_) <<
+  indent(out) <<
     declare_field(&fval, true) << endl;
 
-  generate_deserialize_field(&fkey);
-  generate_deserialize_field(&fval);
+  generate_deserialize_field(out, &fkey);
+  generate_deserialize_field(out, &fval);
 
-  indent(f_service_) <<
+  indent(out) <<
     prefix << ".put(" << key << ", " << val << ");" << endl;
 }
 
-void t_java_generator::generate_deserialize_set_element(t_set* tset,
+void t_java_generator::generate_deserialize_set_element(ofstream& out,
+                                                        t_set* tset,
                                                         string prefix) {
   string elem = tmp("_elem");
   t_field felem(tset->get_elem_type(), elem);
 
-  indent(f_service_) <<
+  indent(out) <<
     declare_field(&felem, true) << endl;
 
-  generate_deserialize_field(&felem);
+  generate_deserialize_field(out, &felem);
 
-  indent(f_service_) <<
+  indent(out) <<
     prefix << ".add(" << elem << ");" << endl;
 }
 
-void t_java_generator::generate_deserialize_list_element(t_list* tlist,
+void t_java_generator::generate_deserialize_list_element(ofstream& out,
+                                                         t_list* tlist,
                                                          string prefix) {
   string elem = tmp("_elem");
   t_field felem(tlist->get_elem_type(), elem);
 
-  indent(f_service_) <<
+  indent(out) <<
     declare_field(&felem, true) << endl;
 
-  generate_deserialize_field(&felem);
+  generate_deserialize_field(out, &felem);
 
-  indent(f_service_) <<
+  indent(out) <<
     prefix << ".add(" << elem << ");" << endl;
 }
 
@@ -799,8 +1013,9 @@
  * @param tfield The field to serialize
  * @param prefix Name to prepend to field name
  */
-void t_java_generator::generate_serialize_field(t_field* tfield,
-                                               string prefix) {
+void t_java_generator::generate_serialize_field(ofstream& out,
+                                                t_field* tfield,
+                                                string prefix) {
   t_type* type = tfield->get_type();
   while (type->is_typedef()) {
     type = ((t_typedef*)type)->get_type();
@@ -812,16 +1027,18 @@
       prefix + tfield->get_name();
   }
   
-  if (type->is_struct()) {
-    generate_serialize_struct((t_struct*)(tfield->get_type()),
-                              prefix + tfield->get_name() + ".");
+  if (type->is_struct() || type->is_xception()) {
+    generate_serialize_struct(out,
+                              (t_struct*)(tfield->get_type()),
+                              prefix + tfield->get_name());
   } else if (type->is_container()) {
-    generate_serialize_container(tfield->get_type(),
+    generate_serialize_container(out,
+                                 tfield->get_type(),
                                  prefix + tfield->get_name());
   } else if (type->is_base_type() || type->is_enum()) {
 
     string name = prefix + tfield->get_name();
-    indent(f_service_) <<
+    indent(out) <<
       "_oprot.";
     
     if (type->is_base_type()) {
@@ -832,24 +1049,30 @@
           "compiler error: cannot serialize void field in a struct: " + name;
         break;
       case t_base_type::TYPE_STRING:
-        f_service_ << "writeString(_otrans, " << name << ");";
+        out << "writeString(_otrans, " << name << ");";
+        break;
+      case t_base_type::TYPE_BOOL:
+        out << "writeBool(_otrans, " << name << ");";
         break;
       case t_base_type::TYPE_BYTE:
-        f_service_ << "writeByte(_otrans, " << name << ");";
+        out << "writeByte(_otrans, " << name << ");";
+        break;
+      case t_base_type::TYPE_I16:
+        out << "writeI16(_otrans, " << name << ");";
         break;
       case t_base_type::TYPE_I32:
-        f_service_ << "writeI32(_otrans, " << name << ");";
+        out << "writeI32(_otrans, " << name << ");";
         break;
       case t_base_type::TYPE_I64:
-        f_service_ << "writeI64(_otrans, " << name << ");";
+        out << "writeI64(_otrans, " << name << ");";
         break;
       default:
-        throw "compiler error: no C++ name for base type " + tbase;
+        throw "compiler error: no Java name for base type " + tbase;
       }
     } else if (type->is_enum()) {
-      f_service_ << "writeI32(_otrans, " << name << ");";
+      out << "writeI32(_otrans, " << name << ");";
     }
-    f_service_ << endl;
+    out << endl;
   } else {
     printf("DO NOT KNOW HOW TO SERIALIZE FIELD '%s%s' TYPE '%s'\n",
            prefix.c_str(),
@@ -864,64 +1087,31 @@
  * @param tstruct The struct to serialize
  * @param prefix  String prefix to attach to all fields
  */
-void t_java_generator::generate_serialize_struct(t_struct* tstruct,
+void t_java_generator::generate_serialize_struct(ofstream& out,
+                                                 t_struct* tstruct,
                                                  string prefix) {
-  string name = tstruct->get_name();
-  const vector<t_field*>& fields = tstruct->get_members();
-  vector<t_field*>::const_iterator f_iter;
-
-  scope_up(f_service_);
-  string _struct = tmp("_struct");
-  string _field = tmp("_field");
-
-  f_service_ <<
-    indent() <<
-    "TStruct " << _struct << " = new TStruct(\"" << name << "\");" << endl <<
-    indent() <<
-    "TField " << _field << " = new TField();" << endl <<
-    indent() <<
-    "_oprot.writeStructBegin(_otrans, " << _struct << ");" << endl;
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    f_service_ <<
-      indent() <<
-      _field << ".name = \"" << (*f_iter)->get_name() << "\";" << endl <<
-      indent() <<
-      _field << ".type = " << type_to_enum((*f_iter)->get_type()) << ";" << endl <<
-      indent() <<
-      _field << ".id = " << (*f_iter)->get_key() << ";" << endl <<
-      indent() <<
-      "_oprot.writeFieldBegin(_otrans, " << _field << ");" << endl;
-    // Write field contents
-    generate_serialize_field(*f_iter, prefix);
-    // Write field closer
-    indent(f_service_) <<
-      "_oprot.writeFieldEnd(_otrans);" << endl;
-  }
-  // Write the struct map
-  f_service_ <<
-    indent() << "_oprot.writeFieldStop(_otrans);" << endl <<
-    indent() << "_oprot.writeStructEnd(_otrans);" << endl;
-
-  scope_down(f_service_);
+  out <<
+    indent() << prefix << ".write(_oprot, _otrans);" << endl;
 }
 
-void t_java_generator::generate_serialize_container(t_type* ttype,
+void t_java_generator::generate_serialize_container(ofstream& out,
+                                                    t_type* ttype,
                                                     string prefix) {
-  scope_up(f_service_);
+  scope_up(out);
   
   if (ttype->is_map()) {
-    indent(f_service_) <<
+    indent(out) <<
       "_oprot.writeMapBegin(_otrans, new TMap(" <<
       type_to_enum(((t_map*)ttype)->get_key_type()) << ", " <<
       type_to_enum(((t_map*)ttype)->get_val_type()) << ", " <<
       prefix << ".size()));" << endl;
   } else if (ttype->is_set()) {
-    indent(f_service_) <<
+    indent(out) <<
       "_oprot.writeSetBegin(_otrans, new TSet(" <<
       type_to_enum(((t_set*)ttype)->get_elem_type()) << ", " <<
       prefix << ".size()));" << endl;
   } else if (ttype->is_list()) {
-    indent(f_service_) <<
+    indent(out) <<
       "_oprot.writeListBegin(_otrans, new TList(" <<
       type_to_enum(((t_list*)ttype)->get_elem_type()) << ", " <<
       prefix << ".size()));" << endl;
@@ -929,81 +1119,84 @@
 
   string iter = tmp("_iter");
   if (ttype->is_map()) {
-    indent(f_service_) <<
+    indent(out) <<
       "for (" <<
       type_name(((t_map*)ttype)->get_key_type()) << " " << iter <<
       " : " <<
       prefix << ".keySet())";
   } else if (ttype->is_set()) {
-    indent(f_service_) <<
+    indent(out) <<
       "for (" <<
       type_name(((t_set*)ttype)->get_elem_type()) << " " << iter <<
       " : " <<
       prefix << ")";
   } else if (ttype->is_list()) {
-    indent(f_service_) <<
+    indent(out) <<
       "for (" <<
       type_name(((t_list*)ttype)->get_elem_type()) << " " << iter <<
       " : " <<
       prefix << ")";
   }
 
-    scope_up(f_service_);
+    scope_up(out);
 
     if (ttype->is_map()) {
-      generate_serialize_map_element((t_map*)ttype, iter, prefix);
+      generate_serialize_map_element(out, (t_map*)ttype, iter, prefix);
     } else if (ttype->is_set()) {
-      generate_serialize_set_element((t_set*)ttype, iter);
+      generate_serialize_set_element(out, (t_set*)ttype, iter);
     } else if (ttype->is_list()) {
-      generate_serialize_list_element((t_list*)ttype, iter);
+      generate_serialize_list_element(out, (t_list*)ttype, iter);
     }
     
     if (ttype->is_map()) {
-      indent(f_service_) <<
+      indent(out) <<
         "_oprot.writeMapEnd(_otrans);" << endl;
     } else if (ttype->is_set()) {
-      indent(f_service_) <<
+      indent(out) <<
         "_oprot.writeSetEnd(_otrans);" << endl;
     } else if (ttype->is_list()) {
-      indent(f_service_) <<
+      indent(out) <<
         "_oprot.writeListEnd(_otrans);" << endl;
     }
     
-    scope_down(f_service_);
+    scope_down(out);
  
-  scope_down(f_service_);  
+  scope_down(out);  
 }
 
 /**
  * Serializes the members of a map.
  *
- */
-void t_java_generator::generate_serialize_map_element(t_map* tmap,
+ */ 
+void t_java_generator::generate_serialize_map_element(ofstream& out,
+                                                      t_map* tmap,
                                                       string iter,
                                                       string map) {
   t_field kfield(tmap->get_key_type(), iter);
-  generate_serialize_field(&kfield, "");
+  generate_serialize_field(out, &kfield, "");
 
   t_field vfield(tmap->get_val_type(), map + ".get(" + iter + ")");
-  generate_serialize_field(&vfield, "");
+  generate_serialize_field(out, &vfield, "");
 }
 
 /**
  * Serializes the members of a set.
  */
-void t_java_generator::generate_serialize_set_element(t_set* tset,
+void t_java_generator::generate_serialize_set_element(ofstream& out,
+                                                      t_set* tset,
                                                       string iter) {
   t_field efield(tset->get_elem_type(), iter);
-  generate_serialize_field(&efield, "");
+  generate_serialize_field(out, &efield, "");
 }
 
 /**
  * Serializes the members of a list.
  */
-void t_java_generator::generate_serialize_list_element(t_list* tlist,
-                                                      string iter) {
+void t_java_generator::generate_serialize_list_element(ofstream& out,
+                                                       t_list* tlist,
+                                                       string iter) {
   t_field efield(tlist->get_elem_type(), iter);
-  generate_serialize_field(&efield, "");
+  generate_serialize_field(out, &efield, "");
 }
 
 /**
@@ -1051,8 +1244,12 @@
     return "void";
   case t_base_type::TYPE_STRING:
     return "String";
+  case t_base_type::TYPE_BOOL:
+    return "boolean";
   case t_base_type::TYPE_BYTE:
     return "byte";
+  case t_base_type::TYPE_I16:
+    return (in_container ? "Short" : "short");
   case t_base_type::TYPE_I32:
     return (in_container ? "Integer" : "int");
   case t_base_type::TYPE_I64:
@@ -1081,9 +1278,14 @@
       case t_base_type::TYPE_VOID:
         throw "NO T_VOID CONSTRUCT";
       case t_base_type::TYPE_STRING:
-        result += " = \"\"";
+        // result += " = \"\"";
+        result += " = null";
+        break;
+      case t_base_type::TYPE_BOOL:
+        result += " = false";
         break;
       case t_base_type::TYPE_BYTE:
+      case t_base_type::TYPE_I16:
       case t_base_type::TYPE_I32:
       case t_base_type::TYPE_I64:
         result += " = 0";
@@ -1106,11 +1308,19 @@
  * @return String of rendered function definition
  */
 string t_java_generator::function_signature(t_function* tfunction,
-                                           string prefix) {
+                                            string prefix) {
   t_type* ttype = tfunction->get_returntype();
-  return
+  std::string result =
     type_name(ttype) + " " + prefix + tfunction->get_name() +
-    "(" + argument_list(tfunction->get_arglist()) + ")";
+    "(" + argument_list(tfunction->get_arglist()) + ") throws ";
+  t_struct* xs = tfunction->get_xceptions();
+  const std::vector<t_field*>& xceptions = xs->get_members();
+  vector<t_field*>::const_iterator x_iter;
+  for (x_iter = xceptions.begin(); x_iter != xceptions.end(); ++x_iter) {
+    result += (*x_iter)->get_type()->get_name() + ", ";
+  }
+  result += "TException";
+  return result;
 }
 
 /**
@@ -1148,8 +1358,12 @@
       throw "NO T_VOID CONSTRUCT";
     case t_base_type::TYPE_STRING:
       return "TType.STRING";
+    case t_base_type::TYPE_BOOL:
+      return "TType.BOOL";
     case t_base_type::TYPE_BYTE:
       return "TType.BYTE";
+    case t_base_type::TYPE_I16:
+      return "TType.I16";
     case t_base_type::TYPE_I32:
       return "TType.I32";
     case t_base_type::TYPE_I64:
@@ -1157,7 +1371,7 @@
     }
   } else if (type->is_enum()) {
     return "TType.I32";
-  } else if (type->is_struct()) {
+  } else if (type->is_struct() || type->is_xception()) {
     return "TType.STRUCT";
   } else if (type->is_map()) {
     return "TType.MAP";
diff --git a/compiler/cpp/src/generate/t_java_generator.h b/compiler/cpp/src/generate/t_java_generator.h
index 0fa9074..2c8e247 100644
--- a/compiler/cpp/src/generate/t_java_generator.h
+++ b/compiler/cpp/src/generate/t_java_generator.h
@@ -31,52 +31,75 @@
   void generate_typedef (t_typedef*  ttypedef);
   void generate_enum    (t_enum*     tenum);
   void generate_struct  (t_struct*   tstruct);
+  void generate_xception(t_struct*   txception);
   void generate_service (t_service*  tservice);
 
   /** Service-level generation functions */
 
+  void generate_java_struct(t_struct* tstruct, bool is_exception);
+
+  void generate_java_struct_definition(std::ofstream& out, t_struct* tstruct, bool is_xception=false, bool in_class=false, bool is_result=false);
+  void generate_java_struct_reader(std::ofstream& out, t_struct* tstruct);
+  void generate_java_struct_result_writer(std::ofstream& out, t_struct* tstruct);
+  void generate_java_struct_writer(std::ofstream& out, t_struct* tstruct);
+
+  void generate_function_helpers(t_function* tfunction);
+
   void generate_service_interface (t_service* tservice);
+  void generate_service_helpers   (t_service* tservice);
   void generate_service_client    (t_service* tservice);
   void generate_service_server    (t_service* tservice);
   void generate_process_function  (t_service* tservice, t_function* tfunction);
 
   /** Serialization constructs */
 
-  void generate_deserialize_field        (t_field*    tfield, 
+  void generate_deserialize_field        (std::ofstream& out,
+                                          t_field*    tfield, 
                                           std::string prefix="");
   
-  void generate_deserialize_struct       (t_struct*   tstruct,
+  void generate_deserialize_struct       (std::ofstream& out,
+                                          t_struct*   tstruct,
                                           std::string prefix="");
   
-  void generate_deserialize_container    (t_type*     ttype,
+  void generate_deserialize_container    (std::ofstream& out,
+                                          t_type*     ttype,
                                           std::string prefix="");
   
-  void generate_deserialize_set_element  (t_set*      tset,
+  void generate_deserialize_set_element  (std::ofstream& out,
+                                          t_set*      tset,
                                           std::string prefix="");
 
-  void generate_deserialize_map_element  (t_map*      tmap,
+  void generate_deserialize_map_element  (std::ofstream& out,
+                                          t_map*      tmap,
                                           std::string prefix="");
 
-  void generate_deserialize_list_element (t_list*     tlist,
+  void generate_deserialize_list_element (std::ofstream& out,
+                                          t_list*     tlist,
                                           std::string prefix="");
 
-  void generate_serialize_field          (t_field*    tfield,
+  void generate_serialize_field          (std::ofstream& out,
+                                          t_field*    tfield,
                                           std::string prefix="");
 
-  void generate_serialize_struct         (t_struct*   tstruct,
+  void generate_serialize_struct         (std::ofstream& out,
+                                          t_struct*   tstruct,
                                           std::string prefix="");
 
-  void generate_serialize_container      (t_type*     ttype,
+  void generate_serialize_container      (std::ofstream& out,
+                                          t_type*     ttype,
                                           std::string prefix="");
 
-  void generate_serialize_map_element    (t_map*      tmap,
+  void generate_serialize_map_element    (std::ofstream& out,
+                                          t_map*      tmap,
                                           std::string iter,
                                           std::string map);
 
-  void generate_serialize_set_element    (t_set*      tmap,
+  void generate_serialize_set_element    (std::ofstream& out,
+                                          t_set*      tmap,
                                           std::string iter);
 
-  void generate_serialize_list_element   (t_list*     tlist,
+  void generate_serialize_list_element   (std::ofstream& out,
+                                          t_list*     tlist,
                                           std::string iter);
 
   /** Helper rendering functions */
@@ -94,14 +117,9 @@
  private:
 
   /** File streams */
+  std::string package_name_;
 
-  std::ofstream f_types_;
-  std::ofstream f_header_;
   std::ofstream f_service_;
-
-  std::ofstream f_client_;
-  std::ofstream f_server_;
-
 };
 
 #endif
diff --git a/compiler/cpp/src/generate/t_php_generator.cc b/compiler/cpp/src/generate/t_php_generator.cc
index efd24c5..6f4b76a 100644
--- a/compiler/cpp/src/generate/t_php_generator.cc
+++ b/compiler/cpp/src/generate/t_php_generator.cc
@@ -687,6 +687,11 @@
             indent() << "}" << endl <<
             indent() << "$" << name << " = " << itrans << "->readAll($_len);" << endl;
           break;
+        case t_base_type::TYPE_BOOL:
+          out <<
+            indent() << "$" << name << " = unpack('c', " << itrans << "->readAll(1));" << endl <<
+            indent() << "$" << name << " = (bool)$" << name << "[1];" << endl;
+          break;
         case t_base_type::TYPE_BYTE:
           out <<
             indent() << "$" << name << " = unpack('c', " << itrans << "->readAll(1));" << endl <<
@@ -748,6 +753,9 @@
         case t_base_type::TYPE_STRING:        
           out << "readString($itrans, $" << name << ");";
           break;
+        case t_base_type::TYPE_BOOL:
+          out << "readBool($itrans, $" << name << ");";
+          break;
         case t_base_type::TYPE_BYTE:
           out << "readByte($itrans, $" << name << ");";
           break;
@@ -975,6 +983,10 @@
             indent() << "$_output .= pack('N', strlen($" << name << "));" << endl <<
             indent() << "$_output .= $" << name << ";" << endl;
           break;
+        case t_base_type::TYPE_BOOL:
+          out <<
+            indent() << "$_output .= pack('c', $" << name << " ? 1 : 0);" << endl;
+          break;
         case t_base_type::TYPE_BYTE:
           out <<
             indent() << "$_output .= pack('c', $" << name << ");" << endl;
@@ -1013,6 +1025,9 @@
         case t_base_type::TYPE_STRING:
           out << "writeString($otrans, $" << name << ");";
           break;
+        case t_base_type::TYPE_BOOL:
+          out << "writeBool($otrans, $" << name << ");";
+          break;
         case t_base_type::TYPE_BYTE:
           out << "writeByte($otrans, $" << name << ");";
           break;
@@ -1225,6 +1240,8 @@
     return "void";
   case t_base_type::TYPE_STRING:
     return "TString";
+  case t_base_type::TYPE_BOOL:
+    return "bool";
   case t_base_type::TYPE_BYTE:
     return "UInt8";
   case t_base_type::TYPE_I16:
@@ -1258,6 +1275,9 @@
       case t_base_type::TYPE_STRING:
         result += " = ''";
         break;
+      case t_base_type::TYPE_BOOL:
+        result += " = false";
+        break;
       case t_base_type::TYPE_BYTE:
       case t_base_type::TYPE_I16:
       case t_base_type::TYPE_I32:
@@ -1330,6 +1350,8 @@
       throw "NO T_VOID CONSTRUCT";
     case t_base_type::TYPE_STRING:
       return "TType::STRING";
+    case t_base_type::TYPE_BOOL:
+      return "TType::BOOL";
     case t_base_type::TYPE_BYTE:
       return "TType::BYTE";
     case t_base_type::TYPE_I16:
diff --git a/compiler/cpp/src/generate/t_php_generator.h b/compiler/cpp/src/generate/t_php_generator.h
index d5bc8e0..0cc837f 100644
--- a/compiler/cpp/src/generate/t_php_generator.h
+++ b/compiler/cpp/src/generate/t_php_generator.h
@@ -41,7 +41,7 @@
 
 
   void generate_php_struct(t_struct* tstruct, bool is_exception);
-  void generate_php_struct_definition(std::ofstream& out, t_struct* tstruct, bool is_xception);
+  void generate_php_struct_definition(std::ofstream& out, t_struct* tstruct, bool is_xception=false);
   void generate_php_struct_reader(std::ofstream& out, t_struct* tstruct);
   void generate_php_struct_writer(std::ofstream& out, t_struct* tstruct);
 
diff --git a/compiler/cpp/src/parse/t_base_type.h b/compiler/cpp/src/parse/t_base_type.h
index 5aebba7..1429d1c 100644
--- a/compiler/cpp/src/parse/t_base_type.h
+++ b/compiler/cpp/src/parse/t_base_type.h
@@ -14,6 +14,7 @@
   enum t_base {
     TYPE_VOID,
     TYPE_STRING,
+    TYPE_BOOL,
     TYPE_BYTE,
     TYPE_I16,
     TYPE_I32,
diff --git a/compiler/cpp/src/parse/t_program.h b/compiler/cpp/src/parse/t_program.h
index 98968ff..abb368b 100644
--- a/compiler/cpp/src/parse/t_program.h
+++ b/compiler/cpp/src/parse/t_program.h
@@ -32,6 +32,7 @@
     name_(name), namespace_() {
     type_void   = new t_base_type("void",   t_base_type::TYPE_VOID);
     type_string = new t_base_type("string", t_base_type::TYPE_STRING);
+    type_bool   = new t_base_type("bool",   t_base_type::TYPE_BOOL);
     type_byte   = new t_base_type("byte",   t_base_type::TYPE_BYTE);
     type_i16    = new t_base_type("i16",    t_base_type::TYPE_I16);
     type_i32    = new t_base_type("i32",    t_base_type::TYPE_I32);
@@ -40,6 +41,7 @@
 
   ~t_program() {
     delete type_string;
+    delete type_bool;
     delete type_byte;
     delete type_i16;
     delete type_i32;
@@ -62,6 +64,7 @@
   // Accessors for global types
   t_type* get_void_type()   const { return type_void;   }
   t_type* get_string_type() const { return type_string; }
+  t_type* get_bool_type()   const { return type_byte;   }
   t_type* get_byte_type()   const { return type_byte;   }
   t_type* get_i16_type()    const { return type_i16;    }
   t_type* get_i32_type()    const { return type_i32;    }
@@ -122,6 +125,7 @@
   // Global base types
   t_type* type_void;
   t_type* type_string;
+  t_type* type_bool;
   t_type* type_byte;
   t_type* type_i16;
   t_type* type_i32;
diff --git a/compiler/cpp/src/thrift.l b/compiler/cpp/src/thrift.l
index 1f4d7fe..1ff7708 100644
--- a/compiler/cpp/src/thrift.l
+++ b/compiler/cpp/src/thrift.l
@@ -36,6 +36,7 @@
 "namespace"   { return tok_namespace; }
 
 "void"        { return tok_void;     }
+"bool"        { return tok_bool;     }
 "byte"        { return tok_byte;     }
 "i16"         { return tok_i16;      }
 "i32"         { return tok_i32;      }
diff --git a/compiler/cpp/src/thrift.y b/compiler/cpp/src/thrift.y
index 069d6c8..e738180 100644
--- a/compiler/cpp/src/thrift.y
+++ b/compiler/cpp/src/thrift.y
@@ -39,6 +39,7 @@
 %token tok_namespace
 
 /** Base datatypes */
+%token tok_bool
 %token tok_byte
 %token tok_string
 %token tok_i16
@@ -368,6 +369,11 @@
       pdebug("BaseType -> tok_string");
       $$ = g_program->get_string_type();
     }
+| tok_bool
+    {
+      pdebug("BaseType -> tok_bool");
+      $$ = g_program->get_bool_type();
+    }
 | tok_byte
     {
       pdebug("BaseType -> tok_byte");
