Hi,
We've got some Ruby code that is creating appointments in a calendar and it works great. What we're trying to do now is add the necessary SOAP to the code so that it will also create and send the appointment request to attendees. This does not seem to work though. The appointment gets created in the owners calendar but no invitation request is delivered to the attendees.
Has anyone else done any SOAP stuff and gotten this to work? Here's a code snippet...
Thanks,
Matt
Code:
def self.createappointment(host, authToken, start, subject, user, advisor, description='')
finish = start+30.minutes
user_obj = User.find_by_ecom(user)
advisor_obj = LdapUser.find(advisor)
#Send request to student
header = SOAP::SOAPHeader.new
context = element('context', nil, {'xmlns' => 'urn:zimbra'}, [
element('authToken', authToken)
])
header.add('context', context)
body = SOAP::SOAPBody.new(element('CreateAppointmentRequest', nil,
{
'xmlns' => 'urn:zimbraMail'
},
[
element('m', nil, {}, [
[element('e', user.mail, {}, [])],
element('inv', nil, {}, [
element('comp', nil,
{
'status' => 'CONF',
'fba' => 'B',
'allDay' => false,
'name' => subject,
'loc' => advisor_obj.buildingName + ' room ' + advisor_obj.roomNumber,
'noBlob' => 1,
'e' => user,
},
[
datetime('s', start),
datetime('e', finish),
element('or', nil,
{
'a' => advisor_obj.uid,
'd' => advisor_obj.uid
}
),
element('at', nil,
{
'a' => user_obj.mail,
'd' => user_obj.name,
'ptst' => 'NE',
'role' => 'REQ',
'sentBy' => advisor_obj.uid,
'cutype' => 'IND',
'rsvp' => '1',
}
),
element('desc', description),
]
),
]),
]),
]
))
envelope = SOAP::SOAPEnvelope.new(header, body)
send_soap(envelope, host)
end