Advertisement
Guest User

Untitled

a guest
Jul 31st, 2011
325
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.73 KB | None | 0 0
  1. I'm using your code from Corporate Addressbook to try to get a list of mails from my gmail account. But I'm stuck, this is what I'm doing:
  2. 1. Sending FolderSync request:
  3. <code>
  4. String uri = mUri + "FolderSync";
  5. String xml = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"
  6. + "<FolderSync xmlns=\"FolderHierarchy:\">\n" +
  7. "\t<SyncKey>0</SyncKey>\n"
  8. + "</FolderSync>";
  9. </code>
  10. 2. This is the response I get back. So far so good
  11. <code>
  12. <?xml version="1.0" encoding="utf-8" ?>
  13. <FolderSync xmlns="FolderHierarchy">
  14.  <Status>1</Status>
  15.  <SyncKey>1311783116298</SyncKey>
  16.  <Changes>
  17.    <Count>14</Count>
  18.    ...
  19.    <Add>
  20.      <ServerId>Mail:^sync_gmail_group</ServerId>
  21.      <ParentId>0</ParentId>
  22.      <DisplayName>[Gmail]</DisplayName>
  23.      <Type>12</Type>
  24.    </Add>
  25.    <Add>
  26.      <ServerId>Mail:DEFAULT</ServerId>
  27.      <ParentId>0</ParentId>
  28.      <DisplayName>Inbox</DisplayName>
  29.      <Type>2</Type>
  30.    </Add>
  31.    ...
  32.  </Changes>
  33. </FolderSync>
  34. </code>
  35. 3. Now I take the ServerId for Inbox (Mail:DEFAULT) and do a Search Request
  36. <code>
  37. String uri = mUri + "Search";
  38. String xml = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
  39. "<Search xmlns=\"Search:\" xmlns:airsync=\"AirSync:\"  xmlns:email=\"Email:\" xmlns:contacts=\"Contacts:\" >\n" +
  40. "<Store>\n" +
  41. "<Name>Mailbox</Name>\n" +
  42. "<Query>\n" +
  43. "<And>\n" +
  44. "<airsync:CollectionId>Mail:DEFAULT</airsync:CollectionId>\n" +
  45. "<FreeText>mail</FreeText>\n" +
  46. "</And>\n" +
  47. "</Query>\n" +
  48. "</Store>\n" +
  49. "</Search>";
  50. </code>
  51. 4. Here is where I get stuck. I get no e-mails in the response just a status 3 error.
  52. <code>
  53. <?xml version="1.0" encoding="utf-8" ?>
  54. <Search xmlns="Search">
  55. <Status>3</Status>
  56. </Search>
  57. </code>
  58. Could you please help me. Thanks
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement