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: Wed, 28 Dec 2005 12:42:02 -0800,    group: microsoft.public.exchange2000.development        back       


Problem cancelling meetings - 409 Conflict Error using XmlHttp   
Hello,

I'm attempting to cancel a meeting using the following code:

string messageUrl = this.GetMessageUrl(messageID);
				string xmlstr = "?Cmd=delete"+
					"&Action=cancel"+
					"&SENDUPDATE=1"+
					"&FormType=Appointment"+
					"&CmdReferring=edit"+
					"&Required="+
					"&Optional="+
					"&Resource="+
					"&MsgID="+messageUrl+
					"&CALENDAR="+messageUrl+
					"&urn:schemas:httpmail:textdescription="+textDescription+
					"&urn:schemas:httpmail:htmldescription="+htmlDescription;

				xmlstr = xmlstr.Replace(":","%3A").Replace("/","%2F");

				XMLHTTP xmlHttp_ = new XMLHTTP();
				xmlHttp_.open("POST", messageUrl, false, user, password);
				xmlHttp_.send(xmlstr);

I always receive a 409 Conflict error.  How can I cancel a meeting?

If I should be using WebDav, can someone please post code that will handle 
this?

Thanks,
Liz
date: Wed, 28 Dec 2005 12:42:02 -0800   author:   liz-kma

Re: Problem cancelling meetings - 409 Conflict Error using XmlHttp   
You can create Meeting cancellation messages simular to how you created the 
invite to delete the appointment from the source mailbox you just need to 
use a WebDAV delete. Meeting cancellation would look something like

server = "servername"
mailbox = "mailbox"
sDestinationURL = "http://" & server & "/exchange/" & mailbox & 
"/drafts/canreq.eml"
Set XMLreq = CreateObject("Microsoft.xmlhttp")
XMLreq.open "PROPPATCH", sDestinationURL, False
xmlstr = "<?xml version=""1.0""?>" _
& "<g:propertyupdate " _
& "    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:"">  " _
& "    <g:set>  " _
& "        <g:prop>  " _
& " 
<g:contentclass>urn:content-classes:calendarmessage</g:contentclass>  " _
& " 
<e:outlookmessageclass>Ipm.Schedule.Meeting.Canceled</e:outlookmessageclass> 
" _
& "            <e:x-priority-long dt:dt=""int"">2</e:x-priority-long>  " _
& "            <mail:subject>Canceled: Test apt123</mail:subject>  " _
& "            <mail:htmldescription>Meeting 
Cancelled</mail:htmldescription>  " _
& "            <cal:dtstart 
dt:dt=""dateTime.tz"">2005-12-28T23:00:00.000Z</cal:dtstart> " _
& "            <cal:dtend 
dt:dt=""dateTime.tz"">2005-12-28T23:30:00.000Z</cal:dtend>  " _
& "            <cal:busystatus>FREE</cal:busystatus>  " _
& "            <cal:alldayevent dt:dt=""boolean"">0</cal:alldayevent>  " _
& "            <cal:meetingstatus>CANCELLED</cal:meetingstatus>  " _
& "            <cal:responserequested 
dt:dt=""boolean"">1</cal:responserequested>  " _
& "            <cal:method>CANCEL</cal:method>  " _
& "            <cal:instancetype>3</cal:instancetype>  " _
& " 
<cal:uid>CD0000008B9511D182D800C04FB1625D64CB89851D50504190EDFD0E8F15B8A3</cal:uid> 
" _
& "            <header:to>Youruser@domain.com</header:to>  " _
& "            <header:cc></header:cc>  " _
& "            <header:bcc></header:bcc>  " _
& "        </g:prop>  " _
& "    </g:set>  " _
& "</g:propertyupdate> "
XMLreq.setRequestHeader "Content-Type", "text/xml;"
XMLreq.setRequestHeader "Translate", "f"
XMLreq.setRequestHeader "Content-Length:", Len(xmlstr)
XMLreq.send(xmlstr)
If (XMLreq.Status >= 200 And XMLreq.Status < 300) Then
  Wscript.echo "Success!   " & "Results = " & XMLreq.Status & ": " & 
XMLreq.statusText
ElseIf XMLreq.Status = 401 then
  Wscript.echo "You don't have permission to do the job! Please check your 
permissions on this item."
Else
  Wscript.echo "Request Failed.  Results = " & XMLreq.Status & ": " & 
XMLreq.statusText
End If

sDestinationURL = "http://" & server & "/exchange/" & mailbox & 
"/##DavMailSubmissionURI##/"
sSource = "http://" & server & "/exchange/" & mailbox & "/drafts/canreq.eml"
XMLreq.open "MOVE", sSource, False
xmlReq.setRequestHeader "Destination", sDestinationURL
XMLreq.setRequestHeader "Content-Type", "message/rfc822;"
XMLreq.setRequestHeader "Translate", "f"
XMLreq.setRequestHeader "Content-Length:", Len(xmlstr)
XMLreq.send(xmlstr)

If (XMLreq.Status >= 200 And XMLreq.Status < 300) Then
  Wscript.echo "Success!   " & "Results = " & XMLreq.Status & ": " & 
XMLreq.statusText
ElseIf XMLreq.Status = 401 then
  Wscript.echo "You don't have permission to do the job! Please check your 
permissions on this item."
Else
  Wscript.echo "Request Failed.  Results = " & XMLreq.Status & ": " & 
XMLreq.statusText
End If

Cheers
Glen


"liz-kma"  wrote in message 
news:480A2D85-4A53-46E4-BD85-45C27951AE58@microsoft.com...
> Hello,
>
> I'm attempting to cancel a meeting using the following code:
>
> string messageUrl = this.GetMessageUrl(messageID);
> string xmlstr = "?Cmd=delete"+
> "&Action=cancel"+
> "&SENDUPDATE=1"+
> "&FormType=Appointment"+
> "&CmdReferring=edit"+
> "&Required="+
> "&Optional="+
> "&Resource="+
> "&MsgID="+messageUrl+
> "&CALENDAR="+messageUrl+
> "&urn:schemas:httpmail:textdescription="+textDescription+
> "&urn:schemas:httpmail:htmldescription="+htmlDescription;
>
> xmlstr = xmlstr.Replace(":","%3A").Replace("/","%2F");
>
> XMLHTTP xmlHttp_ = new XMLHTTP();
> xmlHttp_.open("POST", messageUrl, false, user, password);
> xmlHttp_.send(xmlstr);
>
> I always receive a 409 Conflict error.  How can I cancel a meeting?
>
> If I should be using WebDav, can someone please post code that will handle
> this?
>
> Thanks,
> Liz
date: Thu, 29 Dec 2005 14:41:50 +1100   author:   Glen Scales [MVP]

Re: Problem cancelling meetings - 409 Conflict Error using XmlHttp   
Hi Glen,

This syntax works well!

The only thing I'm missing is a way to get the lis to attendees at a 
meeting.  This doesn't appear to be stored with the appointment, even though 
I submit it as part of the create meeting request.  Is there a place where 
this is stored, or do I just need to save it in a database and retrieve it 
later while processing the cancellations?  (I can already retrieve location, 
start and end date from the appointment in order to aid in constructing this 
request.)

Thanks!

-- Liz
date: Thu, 29 Dec 2005 09:46:05 -0800   author:   liz-kma

Re: Problem cancelling meetings - 409 Conflict Error using XmlHttp   
The attendees are held in the recipients collection of the appointment. To 
access them with WebDAV you can use

For Required Attendees use urn:schemas:mailheader:to
For Option Attendees use urn:schemas:mailheader:cc

If you have any resources this is where it gets a little tricky because 
resources are stored in the BCC field and the BCC field in an envelope 
property you cant retrieve it using urn:schemas:mailheader:bcc. One work 
around for this is to parse this information out of the vCalendar bodypart 
i've posted up some stuff on this a while ago at

http://gsexdev.blogspot.com/2004/11/finding-what-resources-are-being-used.html
and
http://gsexdev.blogspot.com/2004/10/getting-meeting-attendee-status-and.html

Cheers
Glen

"liz-kma"  wrote in message 
news:7DB85E9A-98D4-4300-AF96-501E21F04D87@microsoft.com...
> Hi Glen,
>
> This syntax works well!
>
> The only thing I'm missing is a way to get the lis to attendees at a
> meeting.  This doesn't appear to be stored with the appointment, even 
> though
> I submit it as part of the create meeting request.  Is there a place where
> this is stored, or do I just need to save it in a database and retrieve it
> later while processing the cancellations?  (I can already retrieve 
> location,
> start and end date from the appointment in order to aid in constructing 
> this
> request.)
>
> Thanks!
>
> -- Liz
>
>
date: Fri, 30 Dec 2005 15:02:24 +1100   author:   Glen Scales [MVP]

Re: Problem cancelling meetings - 409 Conflict Error using XmlHttp   
Thank you, Glen!  This is exactly what I was looking for.

-- Liz


"Glen Scales [MVP]" wrote:

> The attendees are held in the recipients collection of the appointment. To 
> access them with WebDAV you can use
> 
> For Required Attendees use urn:schemas:mailheader:to
> For Option Attendees use urn:schemas:mailheader:cc
> 
> If you have any resources this is where it gets a little tricky because 
> resources are stored in the BCC field and the BCC field in an envelope 
> property you cant retrieve it using urn:schemas:mailheader:bcc. One work 
> around for this is to parse this information out of the vCalendar bodypart 
> i've posted up some stuff on this a while ago at
> 
> http://gsexdev.blogspot.com/2004/11/finding-what-resources-are-being-used.html
> and
> http://gsexdev.blogspot.com/2004/10/getting-meeting-attendee-status-and.html
> 
> Cheers
> Glen
> 
> "liz-kma"  wrote in message 
> news:7DB85E9A-98D4-4300-AF96-501E21F04D87@microsoft.com...
> > Hi Glen,
> >
> > This syntax works well!
> >
> > The only thing I'm missing is a way to get the lis to attendees at a
> > meeting.  This doesn't appear to be stored with the appointment, even 
> > though
> > I submit it as part of the create meeting request.  Is there a place where
> > this is stored, or do I just need to save it in a database and retrieve it
> > later while processing the cancellations?  (I can already retrieve 
> > location,
> > start and end date from the appointment in order to aid in constructing 
> > this
> > request.)
> >
> > Thanks!
> >
> > -- Liz
> >
> > 
> 
> 
>
date: Fri, 30 Dec 2005 05:40:04 -0800   author:   liz-kma

Google
 
Web ureader.com


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