This discussion is archived
5 Replies Latest reply: Sep 6, 2007 10:59 PM by 596778 RSS

Creating an event with attendees fails, reading attendees of an event fails

399810 Newbie
Currently Being Moderated
Hi,

i created a TAR for this issue and OSS pointed to this forum to get quick answers. I'll repeat the the case.

Situation:
Doing a proof of concept for one of the largest OCS customers in Germany.

Goal:
Creating an ORACLE WebService that accepts SAP-CRM appointments via XML (String parameter) and creates Appointments with 1-n attendees an invitations via WSTK 9.0.4.2 against Calendar Server 9.0.4.2.

Status:
Basic Java App should create an appointment with more than 1 attendee. This fails.
Furthermore reading the attendees of a manually created appointment with more than one attendees via vEvent.getAttendees() return only the owner / logged in user.

Tried 9.0.4.2 and 10.1.1 WSTK against Calendar Server 10.1.1
Tried with internal an external attendees, up to 3 invitees.

Used Doc:
JavaDoc and Development Guide from otn, as well as
JavaDoc for 9.4.0.2 integrated with the download and the source for testoraptor
(9.0.4.2) aka web services test suite (10.1.1) that come with the official
download of wstk.

Code snippets follow.

Best Regards,
Benjamin Zolper

All form of communication possible (Phone, Email, IM (ICQ/AIM), please request the desired choice.
  • 1. Re: Creating an event with attendees fails, reading attendees of an event f
    399810 Newbie
    Currently Being Moderated
    Code snippets:

    Creating appointment:


    private void CreateAppWithAttendee()
    {
    System.out.println("pretry");
    try
    {
    // create the iCalendar that is to be
    // created on the calendar server
    iCalendar ical = new iCalendar();
    vCalendar vcal = new vCalendar();
    vEvent vevent = new vEvent();


    ical.addvCalendar(vcal);
    vcal.addvComponent(vevent);


    String dtStart = getDtStart();
    String uid = "Test12324532536";

    // set the vEvent attributes
    vevent.setEventClass(vEvent.k_eventClassPrivate);
    vevent.setUid(uid);
    vevent.setXEventType(vevent.k_eventTypeAppointment);
    vevent.setDtStart(dtStart);
    vevent.setDuration("PT01H00M");
    vevent.setLocation("Testlocation");
    vevent.setSummary("Test1223");

    // set the attendee attributes

    vAttendee attend = new vAttendee();
    attend.setValue("mailto:" + "benjamin.zolper@kuttig.com");

    //attend.setCN("Benjamin Zolper");
    attend.setPartStat(vAttendee.k_accepted);
    vevent.addAttendee(attend);


    vevent.setDescription(ical.toString());

    // initialize the event create command
    CreateCommand create = new CreateCommand();

    create.setCmdId("tscmd1");
    create.setiCalendar(ical);

    // create the calendar client SOAP stub
    // and set the basic authentication header

    System.out.println("precws");
    Calendarlet cws = new Calendarlet();

    initWebService(cws);


    // make the SOAP call
    System.out.println("precmd");
    CalendaringResponse response = cws.Create(create.getElement());

    System.out.println(response.getSendBuffer());
    System.out.println(response.getReceiveBuffer());

    }
    catch (Exception exc)
    {
    System.out.println("Error: \n" + exc.getMessage());
    }

    }

    private String getDtStart()
    {
    Calendar today = CalendarUtils.getToday();
    today.set(Calendar.HOUR_OF_DAY, 16);
    String ret_time = CalendarUtils.getUTCDateTime(today);

    return ret_time;
    }

    Reading Attendess (assumes at least one appointment with multiple attendees today):


    public void Validate()
    {

    try
    {
    // initialize the event search command and query
    SearchCommand search = new SearchCommand();

    search.setCmdId("Suche1");

    vQuery query = new vQuery();

    query.setFrom(vQuery.k_queryFromEvent);

    // the start datetime is today midnight
    // the end datetime is today one minute to midnight
    Calendar today = CalendarUtils.getToday();
    Calendar tomorrow = (Calendar)today.clone();

    tomorrow.add(Calendar.DATE, +1);
    tomorrow.add(Calendar.MINUTE, -1);

    query.setWhere(CalendarUtils.getDateRangeQuery(today, tomorrow));

    search.setQuery(query);

    // create the calendar client SOAP stub
    // and set the basic authentication header
    Calendarlet cws = new Calendarlet();

    initWebService(cws);

    // make the SOAP call
    CalendaringResponse response = cws.Search(search.getElement());

    System.out.println(response.getSendBuffer());
    System.out.println(response.getReceiveBuffer());


    Reply reply = (Reply)response.getCalendarReply();

    Vector someiCalendars = iCalendar.unmarshallVector(
    reply.getEntries());
    int numiCalendars = someiCalendars.size();

    if (numiCalendars == 0)
    {

    System.out.println("There were no vEvents returned" +
    " there is a major problem here\n" +
    "Ensure there is at least on event" +
    " within the agenda");
    return;
    }

    for (int i = 0; i < numiCalendars; i++)
    {
    iCalendar iCalObj = (iCalendar)someiCalendars.get(i);

    Vector somevCalendars = iCalObj.getvCalendars();
    int numvCalendars = somevCalendars.size();

    if (numvCalendars == 0)
    {

    System.out.println("There were no vEvents returned" +
    " there is a major problem here");

    return;
    }

    for (int x = 0; x < numvCalendars; x++)
    {
    vCalendar vCalObj = (vCalendar)somevCalendars.get(x);

    Vector somevComponents = vCalObj.getComponents();
    int numvComponents = somevComponents.size();

    if (numvComponents != 1)
    {
    System.out.println( "received a vEvent with more than one" +
    " vComponent (probably a vTimezone)");
    return;
    }

    vEvent vEvent = (vEvent)somevComponents.get(0);

    String uid = vEvent.getUid();

    if (uid == null)
    {
    System.out.println("An event was recieved without a UID" +
    " there is a major problem here");
    return;
    }
    System.out.println(uid);
    System.out.println(vEvent.getDescription());
    System.out.println(vEvent.getSummary());
    System.out.println("Duration:" + vEvent.getDuration());

    // check to see if the organizer is different
    // from the login user
    if (vEvent.isOwnedByUser())
    {
    vAttendee otherattendee;
    vAttendee attendee = vEvent.getUserAttendeeObject();

    if (attendee != null)
    {
    System.out.println(attendee.getCN());
    System.out.println(attendee.getValue());
    }

    Vector someAttendees = vEvent.getAttendees();
    int numAttendees = someAttendees.size();

    System.out.println("Anzahl:"+numAttendees);
    if (numAttendees >= 1)
    {
    for (int k=0; k < numAttendees;k++)
    {
    otherattendee = (vAttendee)someAttendees.get(k);
    System.out.println(otherattendee.getCN());
    System.out.println(otherattendee.getValue());
    System.out.println(otherattendee.getPartStat());
    }

    }

    }
    }
    }
    }

    catch (Exception exc)
    {
    System.out.println("Error: \n" + exc.getMessage());
    }
    }


    Helper:

    public void initWebService(CalendarWebService cws)
    {
    cws.setEndPointURL(this.sEndPointUrl); // URL like Documentation states
    cws.setWantIOBuffers(true);
    BasicAuth auth = new BasicAuth();
    auth.setName("test.zolper");
    auth.setPassword("password");

    cws.setAuthenticationHeader(auth.getElement());

    }

    private String getDtStart()
    {
    Calendar today = CalendarUtils.getToday();
    today.set(Calendar.HOUR_OF_DAY, 16);
    String ret_time = CalendarUtils.getUTCDateTime(today);

    return ret_time;
    }


    Full source is available on request and heavily based on the web services test suite from ORACLE.
  • 2. Re: Creating an event with attendees fails, reading attendees of an event fails
    380399 Newbie
    Currently Being Moderated
    Hi,

    1- Sorry, you can't create meetings inviting attendees. This is an unfortunate limitation.

    2- You should be able to get more attendees back (if there is in fact more attendees in the meeting) by specifiying the following option on the vQuery:

    .setXLimitAttendees(aNumber);

    Just a heads up on the point number 2.

    - It is a very demanding operation for the Calendar Web Services. It may be slow.
    - We know for sure that by 9..0.4.2.31, this feature got broken. It may not work for you if you use something more recent. It got fixed in 10g. If you need this, I invite you to log a support tar. The can back port it for you if needed.

    Regards,

    Frederic Leblanc
    Lead Calendar Web Service Developer
  • 3. Re: Creating an event with attendees fails, reading attendees of an event f
    469098 Newbie
    Currently Being Moderated
    Hi,

    thanks so far.

    1. Uh, thats bad.

    2. Irrelevant because of 1.

    I used WSTK until now because it is more convenient, but i will have to face the facts.
    What about Calendar SDK? Is it possible to create appointments with attendees?
    If so i have a lot of work to do, but maybe a chance to succeed.

    Best Regards,
    Benjamin
  • 4. Re: Creating an event with attendees fails, reading attendees of an event f
    380399 Newbie
    Currently Being Moderated
    I used WSTK until now because it is more convenient, but i will have to face the facts.
    What about Calendar SDK? Is it possible to create appointments with attendees?
    If so i have a lot of work to do, but maybe a chance to succeed.

    Yes.

    Best Regards,
    Benjamin
  • 5. Re: Creating an event with attendees fails, reading attendees of an event f
    596778 Newbie
    Currently Being Moderated
    Hi fleblanc

    I meet save problem now. Could I have your email? I want to ask you some detail question about Calendar WSTK, thanks!

    Best regards,
    Raymond