Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Exchange
2000.active.directory
2000.admin
2000.announcements
2000.app.conversion
2000.applications
2000.clients
2000.clustering
2000.connectivity
2000.development
2000.documentation
2000.general
2000.information.store
2000.interop
2000.kms
2000.misc
2000.protocols
2000.realtime.collabo.
2000.setup
2000.transport
2000.win2000
admin
application.conversion
applications
clients
clustering
connectivity
design
development
misc
mobility
setup
tools
  
 
date: Mon, 9 Jan 2006 09:11:02 -0800,    group: microsoft.public.exchange2000.development        back       


WebDAV - How to update organizer appt when sending meeting update   
Hello,

I have been successful in updating meeting requests and everything works 
fine on the recipient end.  But the appointment in the meeting organizer's 
calendar is never updated.  Should I be using a different method call in the 
calendar region?  Is there another way to do this?

I've posted the code.

Thanks!

-- Liz

			// Build the XML body of the PROPPATCH request.
			string xmlstr = "<?xml version='1.0'?>"
				+ "<g:propertyupdate " + GetXMLNSInfo(false) + ">" 
				+ "<g:set><g:prop>"
				+ "<g:contentclass>urn:content-classes:appointment</g:contentclass>"
				+ "<e:outlookmessageclass>IPM.Appointment</e:outlookmessageclass>"
				+ "<e:x-priority-long dt:dt='int'>2</e:x-priority-long>"
				+ this.GetMessageRegion(messageSubject, htmlDescription)
				+ this.GetCalendarRegion("REQUEST", location, startDate, endDate, 
messageID)
				+ this.GetHeaderRegion(attendees)
				+ GetMapiRegion(false) 
				+ "</g:prop></g:set>"
				+ "</g:propertyupdate>";

			XMLHTTP xmlHttp_ = new XMLHTTP();
			xmlHttp_.open("PROPPATCH", apptURL, false, user, password);
			xmlHttp_.setRequestHeader("Content-Type", "text/xml;");
			xmlHttp_.setRequestHeader("Translate", "f");
			xmlHttp_.setRequestHeader("Content-Length:", xmlstr.Length.ToString());
			xmlHttp_.send(xmlstr);

			string Wscript = GetStatus("PrepareApptUpdate", xmlHttp_);


			string xmlstr = 
				"<?xml version='1.0'?>" 
				+ "<g:propertyupdate " + GetXMLNSInfo(true) + ">" 
				+ "<g:set>" 
				+ "<g:prop>" 
				+ "<g:contentclass>urn:content-classes:calendarmessage</g:contentclass>" 
				+ 
"<e:outlookmessageclass>Ipm.Schedule.Meeting.Request</e:outlookmessageclass>" 
				+ "<e:x-priority-long dt:dt='int'>2</e:x-priority-long>" 
				+ this.GetMessageRegion(messageSubject, htmlDescription)
				+ this.GetCalendarRegion("REQUEST", location, startDate, endDate, 
messageID)
				+ this.GetHeaderRegion(attendees)
				+ GetMapiRegion(true) 
				+ "</g:prop>" 
				+ "</g:set>" 
				+ "</g:propertyupdate> ";

			XMLHTTP xmlHttp_ = new XMLHTTP();
			xmlHttp_.open("PROPPATCH", meetingURL, false, user, password);	
			xmlHttp_.setRequestHeader("Content-Type", "text/xml;");
			xmlHttp_.setRequestHeader("Translate", "f");
			xmlHttp_.setRequestHeader("Content-Length:", xmlstr.Length.ToString());
			xmlHttp_.send(xmlstr);

			string Wscript = GetStatus("PrepareMeetingUpdate", xmlHttp_);

			string submitURL = GetMessageProperty(server + mailbox, 
"urn:schemas:httpmail:", "sendmsg");

			XMLHTTP xmlHttp_ = new XMLHTTP();
			xmlHttp_.open("MOVE", sourceURL, false, user, password);
			xmlHttp_.setRequestHeader("Destination", submitURL);
			xmlHttp_.setRequestHeader("Content-Type", "message/rfc822;");
			xmlHttp_.setRequestHeader("Translate", "f");
			xmlHttp_.setRequestHeader("Content-Length:", xmlStr.Length.ToString());
			xmlHttp_.send(xmlStr);
																	
			string Wscript = GetStatus("Submit", xmlHttp_);


		private string GetXMLNSInfo(bool preventProposeNewTime)
		{
			string strXMLNSInfo = "xmlns:g='DAV:' "
				+ "xmlns:e='http://schemas.microsoft.com/exchange/' "
				+ "xmlns:mapi='http://schemas.microsoft.com/mapi/' "
				+ "xmlns:mapit='http://schemas.microsoft.com/mapi/proptag/' "
				+ "xmlns:x='xml:' "
				+ "xmlns:cal='urn:schemas:calendar:' "
				+ "xmlns:dt='urn:uuid:c2f41010-65b3-11d1-a29f-00aa00c14882/' "
				+ "xmlns:header='urn:schemas:mailheader:' "
				+ "xmlns:mail='urn:schemas:httpmail:' ";

			// prevent 'propose new time option'
			if (preventProposeNewTime)
				strXMLNSInfo += 
"xmlns:y='http://schemas.microsoft.com/mapi/id/{00062002-0000-0000-C000-000000000046}/'";

			return strXMLNSInfo;
		}
		private string GetCalendarRegion(string method, string location, string 
startDate, string endDate, string messageID)
		{
			string strCalInfo = 
				"<cal:location>"+location+"</cal:location>"
				+ "<cal:dtstart dt:dt='dateTime.tz'>"+startDate+"</cal:dtstart>"
				+ "<cal:dtend dt:dt='dateTime.tz'>"+endDate+"</cal:dtend>"
				+ "<cal:alldayevent dt:dt='boolean'>0</cal:alldayevent>"
				+ "<cal:responserequested dt:dt='boolean'>1</cal:responserequested>"
				+ "<cal:method>"+method+"</cal:method>" 
				+ "<cal:reminderoffset dt:dt='int'>900</cal:reminderoffset>";

				strCalInfo += "<cal:instancetype dt:dt='int'>0</cal:instancetype>"
					+ "<cal:busystatus>BUSY</cal:busystatus>"
					+ "<cal:meetingstatus>CONFIRMED</cal:meetingstatus>";

			if (messageID != "")
				strCalInfo += "<cal:uid>"+messageID+"</cal:uid>";

			return strCalInfo;
		}

		private string GetHeaderRegion(string attendees)
		{
			// Set the required and optional attendees and meeting
			// resources of the meeting.
			string strHeaderInfo = "<header:to>" + attendees + "</header:to>" +
				"<header:cc></header:cc>" +
				"<header:bcc></header:bcc>";

			return strHeaderInfo;
		}

		private string GetMessageRegion(string messageSubject, string 
htmlDescription)
		{
			// Set the subject of the meeting.
			string strMailInfo = "<mail:subject>"+messageSubject+"</mail:subject>"+
				"<mail:textdescription>"+this.ConvertToPlainText(htmlDescription)+"</mail:textdescription>"+
				"<mail:htmldescription>"+this.ConvertToHtml(htmlDescription)+"</mail:htmldescription>";

			return strMailInfo;
		}

		private string GetMapiRegion(bool preventProposeNewTime)
		{
			string strMapiInfo = 
				// prevent 'propose new time option'
				"<mapi:finvited dt:dt='boolean'>1</mapi:finvited>" +
				"<mapi:responsestatus dt:dt='int'>1</mapi:responsestatus>" +
				"<mapi:responsestate dt:dt='int'>0</mapi:responsestate>" +
				"<mapi:response_requested dt:dt='boolean'>1</mapi:response_requested>" +
				"<mapi:apptstateflags dt:dt='int'>3</mapi:apptstateflags>" +
				"<mapi:busystatus dt:dt='int'>1</mapi:busystatus>" +
				"<mapi:intendedbusystatus dt:dt='int'>2</mapi:intendedbusystatus>";

			if (preventProposeNewTime)
				strMapiInfo += "<y:0x825A dt:dt='boolean'>1</y:0x825A>";

			return strMapiInfo;
		}
date: Mon, 9 Jan 2006 09:11:02 -0800   author:   liz-kma

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us