Creating an appointment in groupwise with $gwservice PHP

569 views Asked by At

I am trying to create an apointment trough the SOAP library provided by NOVELL. Like so:

  $appointment = new Appointment();
  $appointment->source = 'personal';
  $appointment->class = 'Private';
  $appointment->security = 'Normal';
  $appointment->subject = 'TEST';
  $appointment->startDate = '20110101T000000Z';
  $appointment->endDate = '20110102T000000Z';
  $appointment->allDayEvent = true;

  $sir = new sendItemRequest();
  $sir->item = $appointment;
  $res = $gwservice->sendItemRequest($sir);

A var dump on the $res variable returns:

object(stdClass)#94 (1) {
    ["status"]=>
    object(stdClass)#93 (2) {
        ["code"]=>
        int(59920)
        ["description"]=>
        string(22) "Missing session string"
    }
}

I tried to put the session string, that is returned from the loginrequest, but fail to create an appointment.

I am obviosuly lost. Anyone have any insite on this? Do you have any succesfull snippet of a created item trough the gwservice provided by Novell?

1

There are 1 answers

0
quickshiftin On

Did you check the login result for errors, maybe you don't have a valid session.

<?php
$lres = $gwservice->loginRequest($lr);

// check for errors
if ( $lres->code != 0 ) 
{
    print "code: " . $lres->code . " - " . $lres->description . "\n";
}
else if ( $lres['status']->code == 0 ) 
{
    // save off the session string
    $gwservice->session = $lres['session'];
    print "name: " . $lres['userinfo']->name . "\n";
}