title: Linux -> C++ code : Object Serialization
body: <p>What library should I use for an object serialization that is the input for an .net webservice (meaning that this webservice needs an xml at its input)? </p>
  
  <p><em>As a further question:</em></p>
  
  <p>If using Non Intrusive Version (Boot Serialization), when writing in the xml file what is the exactly code? (<code>oa&lt;&lt;</code> ?). I've tried some solutions but it seems I have error. I can't actually say <code>oa&lt;&lt; g.</code> .</p>
  
  <p>Here is the code:</p>
  
  <pre><code>#include &lt;boost/archive/text_oarchive.hpp&gt;
  #include &lt;boost/archive/text_iarchive.hpp&gt;
  #include &lt;dlfcn.h&gt;
  #include &lt;iostream&gt;
  #include &lt;fstream&gt;
  
  class gps_position
  {
  public:
      int degrees;
      int minutes;
      float seconds;
      gps_position(){};
  };
  
  namespace boost { namespace serialization {
  
      template&lt;class Archive&gt;
      void serialize(Archive &amp; ar, gps_position &amp; g, const unsigned int version)
      {
          ar &amp; g.degrees;
          ar &amp; g.minutes;
          ar &amp; g.seconds;
      }    
  
  } } // namespace boost::serialization
  
  // gps_position g;
  
  int main() {
  
      gps_position obj;
      std::ofstream ofs("filename2.xml");
  
      if(ofs.good()) {
          //const gps_position g;
  
          try {
              boost::archive::xml_oarchive oa(ofs);
  
              // what to write in the xml?
              oa &lt;&lt; ??????????????????;
  
          } catch(boost::archive::archive_exception&amp; ex) {
  
          }
      } 
      return 0;
  }
  </code></pre>