title: Parsing error in Protocol Buffer using C++ API
body: <p>I have a test.proto file having the code shown below. I am using code generated by this file in my client server program. </p>
  
  <pre><code>message Person {
  required string user_name        = 1;
  optional int32  favourite_number = 2;
  repeated string interests        = 3;
  </code></pre>
  
  <p>}</p>
  
  <p>Client side i have no problem to send data but at the server side i am getting protocol buffer parsing error(in the file:\protobuf\message_lite.cc(line123)) says "cant parse message of type 'person' because its missing required field:user_name"</p>
  
  <p>Though i have checked my client side but couldnt find anything wrong but i might missing something at server side which is not reading string data ?</p>
  
  <pre><code>               //Server side code for Protocol Buffers
                 Person filldata;
         google::protobuf::uint32 size;
                 //here i might need google::protobuf::string stsize; Not sure ?
         google::protobuf::io::ArrayInputStream ais(buffer,filldata.ByteSize());
         CodedInputStream coded_input(&amp;ais);
         coded_input.ReadVarint32(&amp;size);
                 //have tried here both coded_input.ReadString and coded_input.ReadRaw
         filldata.ParseFromCodedStream(&amp;coded_input);
  
         cout&lt;&lt;"Message is "&lt;&lt;filldata.DebugString();
                 //still getting same error have no idea what to do exactly to fix it :(
  </code></pre>
  
  <p>Haved <a href="https://developers.google.com/protocol-buffers/docs/reference/cpp/google.protobuf.io.coded_stream#CodedInputStream" rel="nofollow">Looked Here</a> but still couldnt got it from that explanation, Hope someone can fix it.</p>
  
  <p>Thanks!</p>