Results 1 to 3 of 3

Thread: ZClient - ZMailbox.getAppointment - not working?

  1. #1
    Lorenz is offline Beginner Member
    Join Date
    May 2010
    Posts
    2
    Rep Power
    5

    Default ZClient - ZMailbox.getAppointment - not working?

    Hi all,

    I'm trying to build a custom stand-alone client application that accesses my zimbra server. Right now I'm stuck accessing my appointments.

    ZMailBox.getApptSummaries(...) seems to work as expected and returns a result, which then leads to ZAppointmentHit-objects. Using the Appointment-id from the ZAppointmentHit-objects to call ZMailbox.getAppointment(<id>) fails:

    Code:
    com.zimbra.common.service.ServiceException: invalid request: missing required attribute: id
    ExceptionId:main:1274190891873:4d761470c98badd4
    Code:service.INVALID_REQUEST
            at com.zimbra.common.service.ServiceException.INVALID_REQUEST(ServiceException.java:255)
            at com.zimbra.common.soap.Element.checkNull(Element.java:238)
            at com.zimbra.common.soap.Element.getAttribute(Element.java:206)
            at com.zimbra.cs.zclient.ZCalendarItem.<init>(ZCalendarItem.java:71)
            at com.zimbra.cs.zclient.ZAppointment.<init>(ZAppointment.java:24)
            at com.zimbra.cs.zclient.ZMailbox.getAppointment(ZMailbox.java:4259)
            at zclienttest01.Main.main(Main.java:88)
    Stepping into these functions my debugger shows, that ZMailbox.getAppointment(...) builds some kind of request and passes it to invoke(...). invoke(...) returns a com.zimbra.common.soap.Element$JSonElement-object which does contain the Appointment I'm looking for (and it does contain the id-field!).

    Using that JSonElement, ZMailbox tries to call the ZAppointment-constructor which in turn will eventually try to call getAttribute on the Element.

    It seems to me, as if the getAttribute-function does not really know about the JSonElement-subclass and fails to handle it correctly.


    So is this my fault or is it a bug?

    (Am I even supposed to use ZClient for stand-alone apps (I think I read that a couple of times here on the forums)? Or should I write my own code to access the webservices offered by zimbra?)

  2. #2
    Lorenz is offline Beginner Member
    Join Date
    May 2010
    Posts
    2
    Rep Power
    5

    Default

    Btw, I've worked around it for now by copying and adapting the getAppointment-function:

    Code:
    public static ZAppointment myGetAppointment(ZMailbox zmb, String id) throws ServiceException {
        Element req = zmb.newRequestElement(MailConstants.GET_APPOINTMENT_REQUEST);
        req.addAttribute(MailConstants.A_ID, id);
        req.addAttribute(MailConstants.A_SYNC, true);
        JSONElement je = (JSONElement) zmb.invoke(req);
        return new ZAppointment(je.getElement("appt"));
    }

  3. #3
    aina is offline Starter Member
    Join Date
    Aug 2010
    Posts
    2
    Rep Power
    4

    Default

    Had the same problem. Thanks.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. zimbra is not working well... these weeks
    By sfraymondli in forum Administrators
    Replies: 3
    Last Post: 12-30-2009, 01:35 PM
  2. Replies: 0
    Last Post: 09-28-2009, 06:36 PM
  3. [SOLVED] Zimlets not working in renamed domain
    By jcfischer in forum Installation
    Replies: 2
    Last Post: 12-07-2008, 12:02 PM
  4. Zimlets all not working?
    By jadestorm in forum Administrators
    Replies: 16
    Last Post: 10-28-2007, 07:25 PM
  5. Replies: 6
    Last Post: 10-10-2007, 05:11 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
  •