title: Google Contact API throws error
body: <p>We are trying to create and update contact from our application to Google.
  But sometimes it throws </p>
  
  <pre><code>Error occured while creating contacts in Google[Line 41, Column 8, element id] ID must have a value
  </code></pre>
  
  <p>This is the stack trace generated: </p>
  
  <pre><code>com.google.gdata.util.XmlParser.throwParseException(XmlParser.java:722)
      at com.google.gdata.util.XmlParser.parse(XmlParser.java:685)
      at com.google.gdata.util.XmlParser.parse(XmlParser.java:568)
      at com.google.gdata.data.BaseFeed.parseAtom(BaseFeed.java:838)
      at com.google.gdata.wireformats.input.AtomDataParser.parse(AtomDataParser.java:68)
      at com.google.gdata.wireformats.input.AtomDataParser.parse(AtomDataParser.java:39)
      at com.google.gdata.wireformats.input.CharacterParser.parse(CharacterParser.java:100)
      at com.google.gdata.wireformats.input.XmlInputParser.parse(XmlInputParser.java:52)
      at com.google.gdata.wireformats.input.AtomDualParser.parse(AtomDualParser.java:66)
      at com.google.gdata.wireformats.input.AtomDualParser.parse(AtomDualParser.java:34)
      at com.google.gdata.client.Service.parseResponseData(Service.java:1896)
      at com.google.gdata.client.Service.batch(Service.java:1373)
      at com.google.gdata.client.GoogleService.batch(GoogleService.java:756)
  </code></pre>
  
  <p>Because of this bulk of contacts gets failed.</p>
  
  <p>Please tell me what this issue is about.</p>
  
  <pre><code>try{
               if(createContact.getId() == null)
                  {
                   System.out.println("Inside_create_of_update");
                      BatchUtils.setBatchOperationType(createContact, BatchOperationType.INSERT);
                      BatchUtils.setBatchId(createContact,"create");
                      updateFeed.getEntries().add(createContact);
                  }
                  else
                  {
                      //If contact already present in google with this email, we just update this
                      //instead of creating new contact
                      System.out.println("Inside_update_of_update");
                      BatchUtils.setBatchOperationType(createContact, BatchOperationType.UPDATE);
                      BatchUtils.setBatchId(createContact,"update");
                      updateFeed.getEntries().add(createContact);
                  }
                  updateRequestCount++;
              }
              catch(Exception e)
              {
                  System.out.println("Exception occured while updating contact:"+e);
              }
          }
  
          if (updateRequestCount &gt;= 95 || ((i &gt;= (contacts.size() - 1) &amp;&amp; updateRequestCount != 0)))
          {
              Thread.sleep(2000);
              System.out.println("Inside batch update");
              responseFeed = contactService.batch(new URL("https://www.google.com/m8/feeds/contacts/default/full/batch?"
                  + "access_token=" + token), updateFeed);
              System.out.println("Response_feed"+responseFeed);
              for(int v=0;v&lt;responseFeed.getEntries().size();v++)
              {
                  ContactEntry entry = responseFeed.getEntries().get(v);
                  String batchId = BatchUtils.getBatchId(responseFeed.getEntries().get(v));
                  IBatchStatus status = BatchUtils.getStatus(entry);
  </code></pre>