Results 1 to 6 of 6

Thread: Updating Contact in Java

  1. #1
    Join Date
    Mar 2008
    Posts
    9
    Rep Power
    7

    Default Updating Contact in Java

    Code:
    LmcCreateContactRequest contactRequest = new LmcCreateContactRequest();
    contactRequest.setSession(session);
    LmcContact contact = new LmcContact();
    LmcContactAttr attrs[] = new LmcContactAttr[16];
    contact.setAttrs(attrs);
    contactRequest.setContact(contact);
    contactRequest.invoke(serverURL);
    The above will create a contact which is what I want it to do. How do you update an already existing contact? I tried contact.setID(id); which I assumed would update the contact with that id. However, it just creates a duplicate contact with a different id.

  2. #2
    Join Date
    Aug 2005
    Posts
    1,433
    Rep Power
    12

    Default

    You'd be much better served to use ZMailbox.modifyContact().
    Bugzilla - Wiki - Downloads - Before posting... Search!

  3. #3
    Join Date
    Mar 2008
    Posts
    9
    Rep Power
    7

    Default

    I am sure this is rookie overlooking something. In the constructor:
    Code:
    new ZMailbox(new Options(String account, AccountBy accountBy, String password, String uri)
    What is the AccountBy and how do I instantiate it? Also, if you know where there is some examples of its use that would be helpful?

  4. #4
    Join Date
    Aug 2005
    Posts
    1,433
    Rep Power
    12

    Default

    ZMailboxUtil.java is the source for the zmmailbox program. It exercises most of the fuctionality of the ZMailbox class.
    Bugzilla - Wiki - Downloads - Before posting... Search!

  5. #5
    Join Date
    May 2006
    Posts
    81
    Rep Power
    9

    Default

    Check out soap.txt for a description of account by="" and it should give you an idea of how it works:
    http://files.zimbra.com/blog/soap-tmp/soap.txt
    (This might not be the normative url for soap.txt but it works at the moment.)
    Zindus - contact sync for Thunderbird and Zimbra

  6. #6
    Join Date
    Mar 2008
    Posts
    9
    Rep Power
    7

    Talking

    Thanks for your help. Everything is working perfectly!

Similar Threads

  1. Replies: 6
    Last Post: 12-03-2007, 11:06 AM
  2. postfix build error while building Zimbra source
    By anuradha_mihsra in forum Developers
    Replies: 6
    Last Post: 07-19-2007, 10:22 AM
  3. 3.0 to 4.5.3 Upgrade failed (mysql error)
    By dealt in forum Installation
    Replies: 35
    Last Post: 03-19-2007, 10:30 PM
  4. Java 1.5 crashing on PPC Mac 10.4.8
    By bradn in forum Installation
    Replies: 1
    Last Post: 12-08-2006, 05:27 PM
  5. Replies: 0
    Last Post: 12-04-2005, 01:34 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •