Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
Go Back   Zimbra :: Forums > Zimbra Collaboration Suite > Developers

Welcome to the Zimbra :: Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-14-2010, 01:30 PM
Trained Alumni
 
Posts: 343
Default Creating an Appointment Request with SOAP

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
Reply With Quote
  #2 (permalink)  
Old 02-25-2010, 12:39 AM
Zimbra Employee
 
Posts: 70
Default

The element('e', user.mail, {}, []) part should have taken care of sending requests to attendees. Make sure that the soap request created by your code has this element with the correct value.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads

Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

blog.zimbra.com




 

SEO by vBSEO ©2011, Crawlability, Inc.