Hello, I want to send an automatic email to those invited to the appointment, it is 15 minutes before start. That's why I try to change a part of the save procedure ZmCalItem. But I get an error when sending the SOAP request ....
The error :
Code:
 An invalid request was made.
method:	[unknown]
msg:	invalid request: invalid upload ID: 29
code:	service.INVALID_REQUEST
detail:	soap:Sender
trace:	com.zimbra.common.service.ServiceException: invalid request: invalid upload ID: 29 ExceptionId:btpool0-16://10.0.1.202/service/soap/CreateAppointmentRequest:1306331412774:3a30b7cab36c2759 Code:service.INVALID_REQUEST at com.zimbra.common.service.ServiceException.INVALID_REQUEST(ServiceException.java:255) at com.zimbra.cs.service.FileUploadServlet.getUploadServerId(FileUploadServlet.java:199) at com.zimbra.cs.service.FileUploadServlet.isLocalUpload(FileUploadServlet.java:209) at com.zimbra.cs.service.FileUploadServlet.fetchUpload(FileUploadServlet.java:219) at com.zimbra.cs.service.mail.ParseMimeMessage.handleAttachments(ParseMimeMessage.java:461) at com.zimbra.cs.service.mail.ParseMimeMessage.parseMimeMsgSoap(ParseMimeMessage.java:369) at com.zimbra.cs.service.mail.CalendarRequest.handleMsgElement(CalendarRequest.java:120) at com.zimbra.cs.service.mail.CreateCalendarItem.handle(CreateCalendarItem.java:69) at com.zimbra.soap.SoapEngine.dispatchRequest(SoapEngine.java:406) at com.zimbra.soap.SoapEngine.dispatch(SoapEngine.java:281) at com.zimbra.soap.SoapEngine.dispatch(SoapEngine.java:158) at com.zimbra.soap.SoapServlet.doWork(SoapServlet.java:294) at com.zimbra.soap.SoapServlet.doPost(SoapServlet.java:215) at javax.servlet.http.HttpServlet.service(HttpServlet.java:725) at com.zimbra.cs.servlet.ZimbraServlet.service(ZimbraServlet.java:208) at javax.servlet.http.HttpServlet.service(HttpServlet.java:814) at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166) at com.zimbra.cs.servlet.SetHeaderFilter.doFilter(SetHeaderFilter.java:79) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157) at org.mortbay.servlet.UserAgentFilter.doFilter(UserAgentFilter.java:81) at org.mortbay.servlet.GzipFilter.doFilter(GzipFilter.java:132) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388) at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:218) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:422) at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230) at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) at org.mortbay.jetty.handler.rewrite.RewriteHandler.handle(RewriteHandler.java:230) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) at org.mortbay.jetty.handler.DebugHandler.handle(DebugHandler.java:77) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) at org.mortbay.jetty.Server.handle(Server.java:326) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:543) at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:946) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:405) at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:410) at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:451)
request:	

test@zimbratest.local.tec6.net0_3635459d73bc5af46cc7bcbc60413274a1dab868_69643d33363a62343232313139342d393532642d346366372d393463632d6532376137386233353234633b6578703d31333a313330363438393631363737383b76763d313a303b747970653d363a7a696d6272613blalalalaThe following is a new meeting request:

Subject: lalalala 
Organizer: "xxxx" <test@zimbratest.local.tec6.net> 

Time: 1:00:00 PM - 2:00:00 PM GMT +01:00 Brussels, Copenhagen, Madrid, Paris
 Recurrence : Every 2 days End after 9 occurrence(s) Effective May 27, 2011

Invitees: lol@zimbratest.local.tec6.net; test@zimbratest.local.tec6.net; lol@zimbratest.local.tec6.net; test2@zimbratest.local.tec6.net 


*~*~*~*~*~*~*~*~*~*

je vous invite à ma vision conférence : #/#url#/#<html><body><h3>The following is a new meeting request:</h3>

<p>
<table border='0'>
<tr><th align=left>Subject:</th><td>lalalala </td></tr>
<tr><th align=left>Organizer:</th><td>"xxxx" &lt;test@zimbratest.local.tec6.net&gt; </td></tr>
</table>
<p>
<table border='0'>
<tr><th align=left>Time:</th><td>1:00:00 PM - 2:00:00 PM GMT +01:00 Brussels, Copenhagen, Madrid, Paris
 </td></tr><tr><th align=left>Recurrence</th><td>: Every 2 days End after 9 occurrence(s) Effective May 27, 2011</td></tr>
</table>
<p>
<table border='0'>
<tr><th align=left>Invitees:</th><td>lol@zimbratest.local.tec6.net; test@zimbratest.local.tec6.net; lol@zimbratest.local.tec6.net; test2@zimbratest.local.tec6.net </td></tr>
</table>
<div>*~*~*~*~*~*~*~*~*~*</div><br>je vous invite à ma vision conférence : #/#url#/#</body></html>
The SOAP request:
Code:
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
<soap:Header>
<context xmlns="urn:zimbra">
<userAgent xmlns="" name="ZimbraWebClient - FF3.0 (Win)" version="7.0.1_GA_3105"/>
<session xmlns="" id="1371"/>
<account xmlns="" by="name">
test@zimbratest.local.tec6.net</account>
<format xmlns="" type="js"/>
<authToken xmlns="">
0_3635459d73bc5af46cc7bcbc60413274a1dab868_69643d33363a62343232313139342d393532642d346366372d393463632d6532376137386233353234633b6578703d31333a313330363438393631363737383b76763d313a303b747970653d363a7a696d6272613b</authToken>
</context>
</soap:Header>
<soap:Body>
<CreateAppointmentRequest xmlns="urn:zimbraMail" echo="1">
<m xmlns="" l="10">
<inv>
<comp status="CONF" fb="B" class="PUB" transp="O" draft="0" allDay="0" name="lalalala" loc="">
<at role="REQ" ptst="NE" rsvp="1" a="lol@zimbratest.local.tec6.net" d="lol"/>
<at role="REQ" ptst="NE" rsvp="1" a="test@zimbratest.local.tec6.net" d="xxxx"/>
<at role="REQ" ptst="NE" rsvp="1" a="lol@zimbratest.local.tec6.net" d="lol"/>
<at role="REQ" ptst="NE" rsvp="1" a="test2@zimbratest.local.tec6.net" d="decqsec"/>
<s tz="Europe/Brussels" d="20110527T130000"/>
<e tz="Europe/Brussels" d="20110527T140000"/>
<or a="test@zimbratest.local.tec6.net" d="xxxx"/>
<alarm action="DISPLAY">
<trigger>
<rel m="5" related="START" neg="1"/>
</trigger>
</alarm>
<alarm action="EMAIL">
<trigger>
<rel m="15" related="START" neg="1"/>
</trigger>
<at a="test@zimbratest.local.tec6.net"/>
<at a="lol@zimbratest.local.tec6.net" d="lol"/>
<at a="test@zimbratest.local.tec6.net" d="xxxx"/>
<at a="lol@zimbratest.local.tec6.net" d="lol"/>
<at a="test2@zimbratest.local.tec6.net" d="decqsec"/>
</alarm>
</comp>
</inv>
<e a="test@zimbratest.local.tec6.net" t="f" p="xxxx"/>
<su>
lalalala</su>
<mp ct="multipart/alternative">
<mp ct="text/plain">
<content>
The following is a new meeting request: Subject: lalalala Organizer: "xxxx" &lt;test@zimbratest.local.tec6.net&gt; Time: 1:00:00 PM - 2:00:00 PM GMT +01:00 Brussels, Copenhagen, Madrid, Paris Recurrence : Every 2 days End after 9 occurrence(s) Effective May 27, 2011 Invitees: lol@zimbratest.local.tec6.net; test@zimbratest.local.tec6.net; lol@zimbratest.local.tec6.net; test2@zimbratest.local.tec6.net *~*~*~*~*~*~*~*~*~* je vous invite à ma vision conférence : #/#url#/#</content>
</mp>
<mp ct="text/html">
<content>
&lt;html&gt;&lt;body&gt;&lt;h3&gt;The following is a new meeting request:&lt;/h3&gt; &lt;p&gt; &lt;table border='0'&gt; &lt;tr&gt;&lt;th align=left&gt;Subject:&lt;/th&gt;&lt;td&gt;lalalala &lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th align=left&gt;Organizer:&lt;/th&gt;&lt;td&gt;"xxxx" &amp;lt;test@zimbratest.local.tec6.net&amp;gt; &lt;/td&gt;&lt;/tr&gt; &lt;/table&gt; &lt;p&gt; &lt;table border='0'&gt; &lt;tr&gt;&lt;th align=left&gt;Time:&lt;/th&gt;&lt;td&gt;1:00:00 PM - 2:00:00 PM GMT +01:00 Brussels, Copenhagen, Madrid, Paris &lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;th align=left&gt;Recurrence&lt;/th&gt;&lt;td&gt;: Every 2 days End after 9 occurrence(s) Effective May 27, 2011&lt;/td&gt;&lt;/tr&gt; &lt;/table&gt; &lt;p&gt; &lt;table border='0'&gt; &lt;tr&gt;&lt;th align=left&gt;Invitees:&lt;/th&gt;&lt;td&gt;lol@zimbratest.local.tec6.net; test@zimbratest.local.tec6.net; lol@zimbratest.local.tec6.net; test2@zimbratest.local.tec6.net &lt;/td&gt;&lt;/tr&gt; &lt;/table&gt; &lt;div&gt;*~*~*~*~*~*~*~*~*~*&lt;/div&gt;&lt;br&gt;je vous invite à ma vision conférence : #/#url#/#&lt;/body&gt;&lt;/html&gt;</content>
</mp>
</mp>
<attach aid="29"/>
</m>
</CreateAppointmentRequest>
</soap:Body>
</soap:Envelope
The code:
Code:
/**
* Create SOAP doc before save
* params.attendees tabel of attendees
* params.appt (ZmAppt)
*/
 BBBZimlet.prototype._saveAppt=
 function(params,attachmentId,notifyList,callback, errorCallback) {
    this._mode = ZmAppt.ACTION_SAVE;
    this.isSend = false;
	this._recurrence = new ZmRecurrence(params.appt);
 	var needsExceptionId = false;
 	var soapDoc = AjxSoapDoc.create(this._getSoapForMode(params.appt.viewMode, params.appt.isException), "urn:zimbraMail");
 
 	if (params.appt.viewMode == ZmCalItem.MODE_EDIT_SINGLE_INSTANCE &&
 		!params.appt.isException)
 	{
 		ZmCalItem.prototype._addInviteAndCompNum.call(params.appt,soapDoc);
 		needsExceptionId = true;
 	}
 	else if (params.appt.viewMode == ZmCalItem.MODE_EDIT ||
 			 params.appt.viewMode == ZmCalItem.MODE_EDIT_SINGLE_INSTANCE || 
 			 params.appt.viewMode == ZmCalItem.MODE_EDIT_SERIES)
 	{
 		ZmCalItem.prototype._addInviteAndCompNum.call(params.appt,soapDoc);
 		needsExceptionId = params.appt.isException;
 	}
 
 	var accountName = ZmCalItem.prototype.getRemoteFolderOwner.call(params.appt);
 	var invAndMsg = ZmCalItem.prototype._setSimpleSoapAttributes.call(params.appt,soapDoc, attachmentId, notifyList, accountName);
 
 	var comp = invAndMsg.inv.getElementsByTagName("comp")[0];
 	if (needsExceptionId) {
         ZmCalItem.prototype.addExceptionDetails.call(params.appt,soapDoc, comp);
 	} else {
 		// set recurrence rules for appointment (but not for exceptions!)
 		this._recurrence.setSoap(soapDoc, comp);
 	}
 
 	//set alarm data
 	this._setAlarmData(soapDoc, comp, params);
 
 	ZmCalItem.prototype._sendRequest.call(params.appt,soapDoc, accountName, callback, errorCallback);
 };
 
/**
* add alarms and attendees email 
*/
 BBBZimlet.prototype._setAlarmData = function(soapDoc, comp,params){
    var tesE = false;
 	var useAbs = params.appt._useAbsoluteReminder;
 	var time = useAbs ? params.appt._reminderAbs : params.appt._reminderMinutes;
 	if (!time) { return; }
    var emailAlarmNode, email;
 	for (var i = 0, len = params.appt.alarmActions.size(); i < len; i++) {
 		var action = params.appt.alarmActions.get(i);
 		if (action == ZmCalItem.ALARM_EMAIL) {
 			email = appCtxt.get(ZmSetting.CAL_EMAIL_REMINDERS_ADDRESS);
 			if (!email) { continue; }
 		}
         if (action == ZmCalItem.ALARM_DEVICE_EMAIL) {
             email = appCtxt.get(ZmSetting.CAL_DEVICE_EMAIL_REMINDERS_ADDRESS);
             if (!email) { continue; }
             // NOTE: treat device email alarm as a standard email alarm
             action = ZmCalItem.ALARM_EMAIL;
         }
         var isEmailAlarm = action == ZmCalItem.ALARM_EMAIL;
		 
         var alarm = isEmailAlarm && emailAlarmNode;
         if (!alarm) {
             alarm = soapDoc.set("alarm", null, comp);
             alarm.setAttribute("action", action);
             var trigger = soapDoc.set("trigger", null, alarm);
             params.appt._setReminderUnits(soapDoc, trigger, time);
             params.appt._addXPropsToAlarm(soapDoc, alarm);
             if (isEmailAlarm) {
                 emailAlarmNode = alarm;
             }
         }
              // if user has add email in notification preferences
 		if (email) {
		    testE = true;
 			var at = soapDoc.set("at", null, alarm);
 			at.setAttribute("a", email);
			email = null;	
			for(var j = 0; j < params.attendees.length;j++){
			at = soapDoc.set("at", null, alarm);
			at.setAttribute("a", params.attendees[j].mail);
	    }
 		}
 	}
        // if user hasn't add email in notification preferences
	if (!tesE){
			 var isEmailAlarm = action = ZmCalItem.ALARM_EMAIL;
		 
			 var alarm = isEmailAlarm && emailAlarmNode;
			 if (!alarm) {
             alarm = soapDoc.set("alarm", null, comp);
             alarm.setAttribute("action", action);
             var trigger = soapDoc.set("trigger", null, alarm);
             params.appt._setReminderUnits(soapDoc, trigger, 15);
             params.appt._addXPropsToAlarm(soapDoc, alarm);
             if (isEmailAlarm) {
                 emailAlarmNode = alarm;
            }
            }
	        var at = soapDoc.set("at", null, alarm);
 			at.setAttribute("a", this.mail);
			for(var j = 0; j < params.attendees.length;j++){
			at = soapDoc.set("at", null, alarm);
			at.setAttribute("a", params.attendees[j].mail);
			at.setAttribute("d", params.attendees[j].name);}
    	}
 };
 
/**
* Choose type of SOAP request
*/
BBBZimlet.prototype._getSoapForMode =
function(mode, isException) {
	switch (mode) {
		case ZmCalItem.MODE_NEW:
			return "CreateAppointmentRequest";

		case ZmCalItem.MODE_EDIT_SINGLE_INSTANCE:
			return !isException
				? "CreateAppointmentExceptionRequest"
				: "ModifyAppointmentRequest";

		case ZmCalItem.MODE_EDIT:
		case ZmCalItem.MODE_EDIT_SERIES:
			return "ModifyAppointmentRequest";
	}

	return null;
};
Regards, ...