I want some Moore

Blog about stuff and things and stuff. Mostly about SQL server and .Net
posts - 219, comments - 2287, trackbacks - 33

My Links

Advertisement

News

Hi! My name is 
Mladen Prajdić  I'm from Slovenia and I'm currently working as a .Net (C#) and SQL Server developer.

I also speak at local user group meetings and conferences like SQLBits and NT Conference
Welcome to my blog.
SQL Server MVP

My Books

SQL Server MVP Deep Dives 2
The Red Gate Guide to SQL Server Team based Development Free e-book

My Blog Feed via Email
Follow MladenPrajdic on Twitter


Users Online: who's online

Article Categories

Archives

Post Categories

Cool software

Other Blogs

Other stuff

SQL stuff

WebDAV How, What and Problems...

What is WebDAV?

WebDAV stands for "Web-based Distributed Authoring and Versioning".
It's a set of extensions to the HTTP protocol which allows users to collaboratively edit and manage files on remote web servers.
It can also be used to access mail on exchange server. I used it for this.
It great for accessing Exchange because all you need is an XML body sent over HTTP. No installing of anything.


How it works?

WebDAV works with XML. It sends xml requests to the server and gets the responses in return.
It uses MSXML or System.Net.HttpWebRequest in .NET.
WebDAV has some extended keywords besides the standard HTTP ones that do it's bidding :)
Which they are and how are they formed and used can be found on this MSDN site
so i won't go into that.
The type of Request we're making (PROPPATCH, MOVE, PROPFIND, ...) is specified in the HttpWebRequest's Method Property XML PROPPATCH request is created like this:
<?xml version=\"1.0\"?>
<a:propertyupdate xmlns:a=\"DAV:\" xmlns:n0=\"http://schemas.microsoft.com/exchange/\" xmlns:n1=\"http://schemas.microsoft.com/mapi/proptag/\" xmlns:n2=\"urn:schemas:httpmail:\" xmlns:n3=\"urn:schemas:mailheader:\">
 <a:set>
  <a:prop>
   <n0:outlookmessageclass>IPM.Note</n0:outlookmessageclass>
   <n1:0x1000001E>Test Text</n1:0x1000001E>
   <a:contentclass>urn:content-classes:message</a:contentclass>
   <n2:subject>Test Subject</n2:subject>
   <n3:to>valid@emailAddress.com</n3:to>
   <n3:x-mailer>some mailer</n3:x-mailer>
  </a:prop>
 </a:set>
</a:propertyupdate>

Server response is like this:
<?xml version=\"1.0\"?>
<a:multistatus xmlns:a=\"DAV:\" xmlns:d=\"urn:schemas:httpmail:\" xmlns:e=\"urn:schemas:mailheader:\" xmlns:c=\"http://schemas.microsoft.com/mapi/proptag/\" xmlns:b=\"http://schemas.microsoft.com/exchange/\">
 <a:response>
  <a:href>http://servername/Exchange/username/Drafts/Test%20Subject.eml</a:href>
  <a:status>HTTP/1.1 201 Created</a:status>
  <a:propstat>
   <a:status>HTTP/1.1 200 OK</a:status>
   <a:prop>
    <b:outlookmessageclass></b:outlookmessageclass>
    <c:0x1000001E></c:0x1000001E>
    <a:contentclass></a:contentclass>
    <d:subject></d:subject>
    <e:to></e:to>
    <e:x-mailer></e:x-mailer>
   </a:prop>
  </a:propstat>
 </a:response>
</a:multistatus>

Each Property can be saved or removed this way. Custom properties can also be added.

Exchange also has a special folder called ##DavMailSubmissionURI## to which the item must be moved to get sent.


Life of an item in WebDAV generation process and problems that arise

Here i'll explain steps that must be done to each item to get it to work properly. Request methods to use are in CAPS letters.

1. Email message
- PROPPATCH the xml request to drafts folder.
- Attach any Attachment with PUT Request
- MOVE the item from Drafts to ##DavMailSubmissionURI##

2. Appointment
- PROPPATCH the apponitment in the calendar folder

3. Meeting Requests
- Create an appointment in your calendar folder (point 2)
- COPY the Appointment in your calendar folder with a differnet URI
- set the http://schemas.microsoft.com/exchange/outlookmessageclass property to "IPM.Schedule.Meeting.Request"
- set the DAV:contentclass property to "urn:content-classes:calendarmessage"
- set the urn:schemas:calendar:method property to "REQUEST"
- PROPPATCH (save) the meeting requests properties
- Attach any Attachment with PUT Request
- MOVE the item to ##DavMailSubmissionURI##

4. Contacts, tasks and others
- PROPPATCH the request to proper folder
- Attach any Attachment with PUT Request
- MOVE the item from Drafts to ##DavMailSubmissionURI## if needed to send


Development problems and bugs

1. Property naming
A lot of http://schemas.microsoft.com/mapi/proptag/ and http://schemas.microsoft.com/mapi/id/ properties start with '0x'.
If you're using XmlDocument to store xml data like I do then you know that it doesn't allow tags to start with '0'.
Luckily replacing 0x... with x... when loading the document fixes this.
I load the XmlDocument with the xml returned from the server.
I bulid the XML request that gets sent to the server by hand. That's because http://schemas.microsoft.com/mapi/id/
properties need to start with 0x to get set properly while http://schemas.microsoft.com/mapi/proptag/ don't.

2. Case sensitivity
All properties ARE CASE SENSITIVE. all properties can be found on this MSDN site

3. Getting associated appointment from a meeting request reply
I spent a lot of time trying to figue out how to get associated appointment from a meeting request reply.
Since a meeting request is acctually based on an appointment we can deny, accept it or set it to tentative.
Now when this reply is returned to us it is basicaly a message and not an appintment.
It's DAV:contentclass is "urn:content-classes:calendarmessage" and its http://schemas.microsoft.com/exchange/outlookmessageclass
is one of the following: "IPM.Schedule.Meeting.Resp.Pos", "IPM.Schedule.Meeting.Resp.Tent" or "IPM.Schedule.Meeting.Resp.Neg"
The only property that gets preserved is:
http://schemas.microsoft.com/mapi/id/{6ED8DA90-450B-101B-98DA-00AA003F1305}/0x23
which i've named AppointmentAndMeetingRequestResponseConnector :))
This is a base64 encoded property.

4. Appointment Reccurence
I used this document: http://www.ietf.org/rfc/rfc2445.txt
paragraf "4.3.10 Recurrence Rule" and "4.8.5.4 Recurrence Rule"

This is a multivalued property so it's property must be set in the following way:
<c:rrule><r:v xmlns:r=\"xml:\">Recurrencerule Here</r:v></c:rrule>

where "c:" is a prefix for "urn:schemas:calendar:" namespace.

5. Mail body
We have urn:schemas:httpmail:htmldescription and urn:schemas:httpmail:textdescription properties
but there's no property named "Message Body" or something similar.
This property is it:
        http://schemas.microsoft.com/mapi/proptag/0x1000001E


Search

Search with WebDAV is implemented with a SQL dialect. More info can be found on this MSDN site.
Never use Select * because it returns only properties defaulted to the collection and not all of the collections proerties. It's also slower since it has to go look which properties are deafult for the collection. When using search we must cast some properties to proper types.
For example when we search the calendar to get associated appointment from a meeting request reply the
http://schemas.microsoft.com/mapi/id/{6ED8DA90-450B-101B-98DA-00AA003F1305}/0x23 must be cased to "bin.base64"
XML request for this looks like this:
<?xml version=\"1.0\"?>
<a:searchrequest xmlns:a=\"DAV:\">
    <a:sql>
       SELECT \"DAV:contentclass\"
       FROM SCOPE('SHALLOW TRAVERSAL OF \"http://servername/Exchange/username/Calendar/\")
       WHERE  \"http://schemas.microsoft.com/mapi/id/{6ED8DA90-450B-101B-98DA-00AA003F1305}/0x23\"
              = CAST(\"BAAAAIIA4AB0xbcQGoLgCAAAAAAAAAAAAAAAAAAAAAAAAAAATQAAAHZDYWwtVWlkAQAAAENEMDAwMDAwOEI5NTExRDE4MkQ4MDBDMDRGQjE2MjVEOUI1MjY5M0U0MjVBRUU0OTkwMzcxMjE0Njk2NEZERjMA\" as \"bin.base64\")
    </a:sql>
</a:searchrequest>

This requests response looks like this:
<?xml version=\"1.0\"?>
<a:multistatus xmlns:a=\"DAV:\" xmlns:d=\"urn:schemas-microsoft-com:office:office\" xmlns:c=\"xml:\" xmlns:b=\"urn:uuid:c2f41010-65b3-11d1-a29f-00aa00c14882/\">
    <a:response>
        <a:href>http://servername/Exchange/username/Calendar/Some%20Appointment.eml</a:href>
        <a:propstat>
            <a:status>HTTP/1.1 200 OK</a:status>
            <a:prop>
                <a:contentclass>urn:content-classes:appointment</a:contentclass>
            </a:prop>
        </a:propstat>
    </a:response>
</a:multistatus>

Href property returns the associated appointment URI.


Well that's about it... :)

WebDAV is a cool protocol if you ask me and i like it.
It's very simple and powerfull to use but it's hard to find all of the little details.

You can also manipulate MS Office files with it.
Oracle and Adobe also support it and a few others like Apache, MS IIS, Subversion (open source control program)...


Code

This a class I use for XML request:
public class Request
{
    #region Variables
    private HttpWebRequest _HttpRequest;
    private byte[] _HttpRequestBody;
    #endregion
    #region Constructors
    /// <SUMMARY>
    /// Init class
    /// </SUMMARY>
    /// <PARAM name="uri">Request URI</PARAM>
    /// <PARAM name="body">Request body (byte array)</PARAM>
    /// <PARAM name="methodName">Request method name</PARAM>
    /// <PARAM name="contentType">Request Content type</PARAM>
    /// <PARAM name="httpRequestHeaders">Request HTTP Headers</PARAM>
    public Request(string uri, byte[] body, string methodName, string contentType, WebHeaderCollection httpRequestHeaders)
    {
        try
        {
        _HttpRequest = (System.Net.HttpWebRequest)HttpWebRequest.Create(uri);
        _HttpRequest.Credentials = new NetworkCredential("userName", "password", "domain");
        _HttpRequestBody = body;
        _HttpRequest.Method = methodName;
        _HttpRequest.Headers = (httpRequestHeaders ?? new WebHeaderCollection);
        _HttpRequest.ContentType = contentType;
        }
        catch (Exception ex)
        {
        throw ex;
        }
    }
    /// <SUMMARY>
    /// Init class
    /// </SUMMARY>
    /// <PARAM name="uri">Request URI</PARAM>
    /// <PARAM name="body">Request body (string)</PARAM>
    /// <PARAM name="methodName">Request method name</PARAM>
    /// <PARAM name="contentType">Request Content type</PARAM>
    /// <PARAM name="httpRequestHeaders">Request HTTP Headers</PARAM>
    public Request(string uri, string body, string methodName, string contentType, WebHeaderCollection httpRequestHeaders)
        : this(uri, Encoding.UTF8.GetBytes(body), methodName, contentType, httpRequestHeaders)
    { }
    #endregion
    #region Methods
    /// <SUMMARY>
    /// Run request
    /// </SUMMARY>
    /// <RETURNS>XML document containting response XML</RETURNS>
    public XmlDocument RunRequest()
    {
        XmlDocument xml = new XmlDocument();
        try
        {
            _HttpRequest.ContentLength = _HttpRequestBody.Length;
            Stream requestStream = _HttpRequest.GetRequestStream();
            requestStream.Write(_HttpRequestBody, 0, _HttpRequestBody.Length);
            requestStream.Close();
            WebResponse httpResponse = (System.Net.HttpWebResponse)_HttpRequest.GetResponse();
            // handles methods like move, etc that don't return anything
            if (httpResponse.ContentLength == 0)
                xml.LoadXml("<RESPONSE><ZEROCONTENTLENGTH><method>" + _HttpRequest.Method + "</method></ZEROCONTENTLENGTH></RESPONSE>");
            else
            {
                Stream receiveStream = httpResponse.GetResponseStream();
                StreamReader sr = new StreamReader(receiveStream, System.Text.Encoding.GetEncoding("utf-8"));
                string xmlResult = sr.ReadToEnd();
                // this is a very stupid exchange xml "bug"
                // XmlDocument.LoadXml returns an error if the tag starts with 0 (i.e.: <dav:0x008a></>)
                // so we must change the xml's :0x to :x Exchange doesn't care about it :)
                xmlResult = xmlResult.Replace(":0x", ":x");
                xml.LoadXml(xmlResult);
                httpResponse.Close();
            }
        }
        catch (Exception ex)
        {
            // A few of the most important and common error.
            //
            // 403 - Forbidden      - This means there is not enough access to create this folder.
            // 405 - Method not allowed - This can mean the user is overwriting a folder (among
            //       other things).
            // 404 - Not found      - This is often used to find out if something exists.
            // 409 - Conflict       - Happens when we want to to do something with an item that hasn't been
            //                proppatched yet. Usually happens when we create a message, we have to
            //                proppacth it and then add attachments.
            // 505 - Server unavailable
            xml.LoadXml("<RESPONSE><ERROR><method>" + _HttpRequest.Method + "</method><MESSAGE>" + ex.Message + "</MESSAGE></ERROR></RESPONSE>");
        }
        return xml;
    }
    /// <SUMMARY>
    /// Adds range of rows to return
    /// </SUMMARY>
    /// <PARAM name="startRow">Start at row</PARAM>
    /// <PARAM name="endRow">End at row</PARAM>
    public void AddRange(int startRow, int endRow)
    {
        _HttpRequest.AddRange("rows", startRow, endRow);
    }
    #endregion
}

This is a class i use for creating a recurrence rule:
using System;
using System.Collections.Generic;
using System.Text;
namespace WebDAV
{
    public class Recurrence
    {
        /*
        Standard definition:
        recur = "FREQ"=freq *(
        ; either UNTIL or COUNT may appear in a 'recur',
        ; but UNTIL and COUNT MUST NOT occur in the same 'recur'
        ( ";" "UNTIL" "=" enddate ) /
        ( ";" "COUNT" "=" 1*DIGIT ) /
        ; the rest of these keywords are optional,
        ; but MUST NOT occur more than once
        ( ";" "INTERVAL" "=" 1*DIGIT )          /
        ( ";" "BYSECOND" "=" byseclist )        /
        ( ";" "BYMINUTE" "=" byminlist )        /
        ( ";" "BYHOUR" "=" byhrlist )           /
        ( ";" "BYDAY" "=" bywdaylist )          /
        ( ";" "BYMONTHDAY" "=" bymodaylist )    /
        ( ";" "BYYEARDAY" "=" byyrdaylist )     /
        ( ";" "BYWEEKNO" "=" bywknolist )       /
        ( ";" "BYMONTH" "=" bymolist )          /
        ( ";" "BYSETPOS" "=" bysplist )         /
        ( ";" "WKST" "=" weekday )              /
        */
        #region Range of Recurrence
        private DateTime _RangeStartDate;
        private DateTime _RangeEndDate;
        private int _Occurrences;
        private bool _NoEndDate;
        #endregion
        #region AppointmentTime
        private DateTime _AppointmentStartDate;
        private DateTime _AppointmentEndDate;
        private DateTime _AppointmentDuration;
        #endregion
        #region Recurrence Pattern
        private string _RecurrenceType;
        private int _Interval;
        private string _WeekStart;
        private string _ByDay;
        private string _ByMonthDay;
        private string _ByYearDay;
        private string _ByWeekNumber;
        private string _ByMonth;
        private int _BySetPos;
        private string _RRule;
        #endregion
        public Recurrence()
        {
            _RangeStartDate = DateTime.MinValue;
            _RangeEndDate = DateTime.MinValue;
            _Occurrences = -1;
            _NoEndDate = false;
            _AppointmentStartDate = DateTime.MinValue;
            _AppointmentEndDate = DateTime.MinValue;
            _AppointmentDuration = DateTime.MinValue;
            _RecurrenceType = Enums.RecurrenceType.Daily;
            _Interval = -1;
            _WeekStart = Enums.DayOfWeek.Sunday;
            _ByDay = string.Empty;
            _ByMonthDay = string.Empty;
            _ByYearDay = string.Empty;
            _ByWeekNumber = string.Empty;
            _ByMonth = string.Empty;
            _BySetPos = 0;
            _RRule = string.Empty;
        }
        #region Properties
        public DateTime RangeStartDate
        {
            get { return _RangeStartDate; }
            set { _RangeStartDate = value; }
        }
        public DateTime RangeEndDate
        {
            get { return _RangeEndDate; }
            set { _RangeEndDate = value; }
        }
        public int Occurrences
        {
            get { return _Occurrences; }
            set { _Occurrences = value; }
        }
        public bool NoEndDate
        {
            get { return _NoEndDate; }
            set { _NoEndDate = value; }
        }
        public DateTime AppointmentStartDate
        {
            get { return _AppointmentStartDate; }
            set { _AppointmentStartDate = value; }
        }
        public DateTime AppointmentEndDate
        {
            get { return _AppointmentEndDate; }
            set { _AppointmentEndDate = value; }
        }
        public DateTime AppointmentDuration
        {
            get { return _AppointmentDuration; }
            set { _AppointmentDuration = value; }
        }
        public string RecurrenceType
        {
            get { return _RecurrenceType; }
            set { _RecurrenceType = value; }
        }
        public int Interval
        {
            get { return _Interval; }
            set { _Interval = value; }
        }
        public string WeekStart
        {
            get { return _WeekStart; }
            set { _WeekStart = value; }
        }
        public int Position
        {
            get { return _BySetPos; }
            set { _BySetPos = value; }
        }
        #endregion
        #region Methods
        public string GetRecurrenceRule()
        {
            _RRule = "RRULE:";
            _RRule += "FREQ=" + _RecurrenceType;
            _RRule += ";INTERVAL=" + _Interval;
            if (_ByDay != string.Empty)
                _RRule += ";BYDAY=" + _ByDay.TrimEnd(',');
            if (_ByMonth != string.Empty)
                _RRule += ";BYMONTH=" + _ByMonth.TrimEnd(',');
            if (_ByMonthDay != string.Empty)
                _RRule += ";BYMONTHDAY=" + _ByMonthDay.TrimEnd(',');
            if (_ByYearDay != string.Empty)
                _RRule += ";BYYEARDAY=" + _ByYearDay.TrimEnd(',');
            if (_ByWeekNumber != string.Empty)
                _RRule += ";BYWEEKNO=" + _ByWeekNumber.TrimEnd(',');
            if (_BySetPos != 0)
                _RRule += ";BYSETPOS=" + _BySetPos;
            _RRule += ";WKST=" + _WeekStart;
            if (!_NoEndDate)
            {
                if (_AppointmentEndDate > DateTime.MinValue)
                    _RRule += ";UNTIL=" + _AppointmentEndDate.ToUniversalTime().ToString("yyyyMMddTHHmmssZ");
                else if (_Occurrences > 0)
                    _RRule += ";COUNT=" + _Occurrences;
            }
            return "<r:v xmlns:r=\"xml:\">" + _RRule.ToUpper() + "</r:v>";
        }
        public void AddDayOfMonth(int[] positionInMonth)
        {
            for (int i = 0; i < positionInMonth.Length; i++)
            {
                _ByMonthDay += positionInMonth[i].ToString() + ",";
            }
        }
        public void AddDayOfYear(int[] positionInYear)
        {
            for (int i = 0; i < positionInYear.Length; i++)
            {
                _ByYearDay += positionInYear[i].ToString() + ",";
            }
        }
        public void AddDayOfWeek(Enums.DayOfWeek dayOfWeek, int positionInWeek)
        {
            _ByDay += positionInWeek.ToString() + dayOfWeek + ",";
        }
        public void AddDayOfWeek(Enums.DayOfWeek dayOfWeek)
        {
            _ByDay += dayOfWeek + ",";
        }
        public void AddWeekOfYear(int[] positionInYear)
        {
            for (int i = 0; i < positionInYear.Length; i++)
            {
                _ByWeekNumber += positionInYear[i].ToString() + ",";
            }
        }
        public void AddMonthOfYear(int[] positionInYear)
        {
            for (int i = 0; i < positionInYear.Length; i++)
            {
                _ByMonth += positionInYear[i].ToString() + ",";
            }
        }
        #endregion
    }
}

This is a request and response to get well known Exchange folder names since they are localized:
<?xml version="1.0" ?>
<a:propfind xmlns:a="DAV:" xmlns:n0="urn:schemas:httpmail:">
    <a:prop>
        <n0:calendar></n0:calendar>
        <n0:contacts></n0:contacts>
        <n0:deleteditems></n0:deleteditems>
        <n0:drafts></n0:drafts>
        <n0:inbox></n0:inbox>
        <n0:journal></n0:journal>
        <n0:notes></n0:notes>
        <n0:outbox></n0:outbox>
        <n0:sentitems></n0:sentitems>
        <n0:tasks></n0:tasks>
    </a:prop>
</a:propfind>
<?xml version=\"1.0\"?>
<a:multistatus xmlns:a=\"DAV:\" xmlns:d=\"urn:schemas:httpmail:\" xmlns:e=\"urn:schemas-microsoft-com:office:office\" xmlns:c=\"xml:\" xmlns:b=\"urn:uuid:c2f41010-65b3-11d1-a29f-00aa00c14882/\">
    <a:response>
        <a:href>http://servername/Exchange/username/</a:href>
        <a:propstat>
            <a:status>HTTP/1.1 200 OK</a:status>
            <a:prop>
                <d:calendar>http://servername/Exchange/username/Calendar</d:calendar>
                <d:contacts>http://servername/Exchange/username/Contacts</d:contacts>
                <d:deleteditems>http://servername/Exchange/username/Deleted%20Items</d:deleteditems>
                <d:drafts>http://servername/Exchange/username/Drafts</d:drafts>
                <d:inbox>http://servername/Exchange/username/Inbox</d:inbox>
                <d:journal>http://servername/Exchange/username/Journal</d:journal>
                <d:notes>http://servername/Exchange/username/Notes</d:notes>
                <d:outbox>http://servername/Exchange/username/Outbox</d:outbox>
                <d:sentitems>http://servername/Exchange/username/Sent%20Items</d:sentitems>
                <d:tasks>http://servername/Exchange/username/Tasks</d:tasks>
            </a:prop>
        </a:propstat>
    </a:response>
</a:multistatus>

kick it on DotNetKicks.com

Print | posted on Saturday, April 08, 2006 7:41 PM |

Feedback

Gravatar

# re: WebDAV How, What and Problems...

Great post! just what I was looking for...
5/22/2006 12:13 AM | Jay
Gravatar

# 403 forbidden error

I trying to send mail with attachment. when i am at this position the error came

MOVEResponse = (System.Net.HttpWebResponse)MOVERequest.GetResponse();
6/20/2006 2:33 PM | Rameshwar Sharma
Gravatar

# PROPPATCH method for Tasks

I want to be able to add tasks through webDAV in exchange. Do you know how to do that or any good sites/documentation that could help me achieve that?

Cheers.
6/21/2006 11:08 AM | MPH
Gravatar

# re: WebDAV How, What and Problems...

Rameshwar Sharma,
with the info you provided there's no way i can help you.
what is the error you get?
6/21/2006 1:22 PM | Mladen
Gravatar

# Email Problem

I am using WebDav and sending mail through C#.net and i am getting (403) forbidden Error on Move Method request, what should i do please suggest me. Here is the code



System.Net.HttpWebRequest PUTRequest;
System.Net.WebResponse PUTResponse;
System.Net.HttpWebRequest MOVERequest;
System.Net.WebResponse MOVEResponse;
System.Net.CredentialCache MyCredentialCache;
string strMailboxURI = "";
string strSubURI = "";
string strTempURI = "";
string strServer = "ServerName";
string strPassword = "Password";
string strDomain = "Domain";
string strAlias = "EmailAddress";
string strTo = "rameshwar.sharma@ecotechservcices.com";
string strSubject = "WebDAV message test";
string strText = "This message was sent using WebDAV.";
string strBody = "";
byte[] bytes = null;
System.IO.Stream PUTRequestStream = null;

try
{
System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("en-us");
// Build the mailbox URI.
strMailboxURI = "http://" + strServer + "/exchange/" + strAlias;

// Build the submission URI for the message. If Secure
// Sockets Layer (SSL) is set up on the server, use
// "https://" instead of "http://".
strSubURI = "http://" + strServer + "/exchange/" + strAlias
+ "/##DavMailSubmissionURI##/";

// Build the temporary URI for the message. If SSL is set
// up on the server, use "https://" instead of "http://".
strTempURI = "http://" + strServer + "/exchange/" + strAlias
+ "/drafts/" + strSubject + ".eml";

// Construct the RFC 822 formatted body of the PUT request.
// Note: If the From: header is included here,
// the MOVE method request will return a
// 403 (Forbidden) status. The From address will
// be generated by the Exchange server.


strBody = "To: " + strTo + "\n" +
"Subject: " + strSubject + "\n" +
"Date: " + System.DateTime.Now +
"X-Mailer: test mailer" + "\n" +
"MIME-Version: 1.0" + "\n" +
"Content-Type: text/plain;" + "\n" +
"Charset = \"iso-8859-1\"" + "\n" +
"Content-Transfer-Encoding: 7bit" + "\n" +
"\n" + strText;

// Create a new CredentialCache object and fill it with the network
// credentials required to access the server.
MyCredentialCache = new System.Net.CredentialCache();
MyCredentialCache.Add(new System.Uri(strMailboxURI),
"NTLM",
new System.Net.NetworkCredential("UserName", strPassword, strDomain)
);

// Create the HttpWebRequest object.
PUTRequest = (System.Net.HttpWebRequest)HttpWebRequest.Create(strTempURI);

// Add the network credentials to the request.
PUTRequest.Credentials = MyCredentialCache;

// Specify the PUT method.
PUTRequest.Method = "PUT";

// Encode the body using UTF-8.
bytes = Encoding.UTF8.GetBytes((string)strBody);

// Set the content header length. This must be
// done before writing data to the request stream.
PUTRequest.ContentLength = bytes.Length;

// Get a reference to the request stream.
PUTRequestStream = PUTRequest.GetRequestStream();

// Write the message body to the request stream.
PUTRequestStream.Write(bytes, 0, bytes.Length);

// Close the Stream object to release the connection
// for further use.
PUTRequestStream.Close();

// Set the Content-Type header to the RFC 822 message format.
PUTRequest.ContentType = "message/rfc822";

// PUT the message in the Drafts folder of the
// sender's mailbox.
PUTResponse = (System.Net.HttpWebResponse)PUTRequest.GetResponse();

// Create the HttpWebRequest object.
MOVERequest = (System.Net.HttpWebRequest)HttpWebRequest.Create(strTempURI);

// Add the network credentials to the request.
MOVERequest.Credentials = MyCredentialCache;

// Specify the MOVE method.
MOVERequest.Method = "MOVE";

// Set the Destination header to the
// mail submission URI.
MOVERequest.Headers.Add("Destination", strSubURI);

// Send the message by moving it from the Drafts folder of the
// sender's mailbox to the mail submission URI.
MOVEResponse = (System.Net.HttpWebResponse)MOVERequest.GetResponse();

Console.WriteLine("Message successfully sent.");

// Clean up.
PUTResponse.Close();
MOVEResponse.Close();

}
catch (Exception ex)
{
// Catch any exceptions. Any error codes from the PUT
// or MOVE method requests on the server will be caught
// here, also.
Console.WriteLine(ex.Message);
}
7/3/2006 9:19 AM | Rameshwar Sharma
Gravatar

# re: WebDAV How, What and Problems...

well on the first look i think that
string strAlias = "EmailAddress";
must be your username to the exchange account and
not your email address.
7/3/2006 10:20 AM | Mladen
Gravatar

# re: WebDAV How, What and Problems...

I am Using WEBDAV to post the meeting request through my ASP.NET application. When I post the Recurrence pattern for the two months. Only one month of the organizer's calender is updated. But when the attendees accepted the meeting their calendar is updated for two months. And also In the "When: " title shows only the first occurence of the meeting only. What should be the problem?

Thanks in advance.
7/4/2006 12:33 PM | Ganeshgopu
Gravatar

# re: WebDAV How, What and Problems...

What is your exchange server version and outlook versions of your users?

Outlook 2003 has improved recurrence pattern recognition than Outlook 2000.
But neither fully supports the reccurence pattern
that is specified on the site in point
4. Appointment Reccurence
of this artice.

What is your reccurence pattern?
7/4/2006 12:37 PM | Mladen
Gravatar

# Here My Problem....

Thanks for the Immediate ResponseMladen. Actually I am using Exchange server Version: 6.5.6944.0. And I am using Webaccess to access the mailbox.


And Here I hav pasted my code

Rec_Dates = Find_Days(l_sno)
strCalInfo = "<cal:location>" & location & "</cal:location>" & _
"<cal:dtstart dt:dt=""dateTime.tz"">" & Fromdt.ToString("yyyy-MM-dd") & "T" & Fromdt.ToString("HH:mm:ss") & ".000Z" & "</cal:dtstart>" & _
"<cal:dtend dt:dt=""dateTime.tz"">" & Fromdt.ToString("yyyy-MM-dd") & "T" & Todt.ToString("HH:mm:ss") & ".000Z" & "</cal:dtend>" & _
"<cal:instancetype dt:dt=""int"">1</cal:instancetype>" & _
"<cal:busystatus>BUSY</cal:busystatus>" & _
"<cal:meetingstatus>CONFIRMED</cal:meetingstatus>" & _
"<cal:recurtype>2</cal:recurtype>" & _
"<cal:alldayevent dt:dt=""boolean"">0</cal:alldayevent>" & _
"<cal:timezoneid>cdoHongkong</cal:timezoneid>" & _
"<cal:responserequested dt:dt=""boolean"">1</cal:responserequested>" & _
" <cal:rdate dt:dt=""mv.dateTime.tz"">" & Rec_Dates & _
" </cal:rdate> "




Function Find_Days(ByVal l_sno As Integer) As String
Dim Fms_Obj As New FMS.Database
Dim Fms_Ds As New DataSet
Dim St_Time As DateTime
Dim End_Time As DateTime
Fms_Obj.GetDataSet("SELECT DISTINCT(F_BD_FROMTIME),F_BD_TOTIME FROM BOOKDETDATE WHERE F_BD_ID = " & l_sno, Fms_Ds)
Dim Cnt As Integer
For Cnt = 0 To Fms_Ds.Tables(0).Rows.Count - 1
St_Time = CDate(Fms_Ds.Tables(0).Rows(Cnt).Item(0)).AddHours(-8)
End_Time = CDate(Fms_Ds.Tables(0).Rows(Cnt).Item(1)).AddHours(-8)
Find_Days = Find_Days & "<x:v>" & CDate(St_Time).ToString("yyyy-MM-dd") & "T" & CDate(St_Time).ToString("HH:mm:ss") & ".000Z" & "</x:v>"
Find_Days = Find_Days & "<x:v>" & CDate(End_Time).ToString("yyyy-MM-dd") & "T" & CDate(End_Time).ToString("HH:mm:ss") & ".000Z" & "</x:v>"
Next
If Not Fms_Obj Is Nothing Then Fms_Obj.Close()
Return Find_Days
End Function
7/4/2006 1:53 PM | Ganeshgopu
Gravatar

# re: WebDAV How, What and Problems...

Hi Mladen,

Could you respond the above mail?

Thanks.
7/5/2006 1:03 PM | Ganeshgopu
Gravatar

# get all Sent Items collection

I want to get all sent items and inbox items from exchange server for a particular user, Please Help me.

Thanks

Rameshwar
7/5/2006 2:09 PM | Rameshwar Sharma
Gravatar

# re: WebDAV How, What and Problems...

Ganeshgopu:
i never set the rdate property. i don't know if it's even multivalued.

i always set the rrule property which is multivalued but you don't really need multiple values, because every rule can be presented in a single string value.

Rameshwar Sharma:
Look at Search sectino of this article. SQL search is preety simple and quite powerfull.
7/5/2006 2:58 PM | Mladen
Gravatar

# re: WebDAV How, What and Problems...

Thanks for your response Mladen. Whats my problem with rrule is, can set different dates in any manner in a recurrence meeting. But I don't know how to set different timings for the instances. Say for example,
In between 7/5/2006 to 7/15/2006, I have to request with the following timinigs.
On every Saturday 05:00 am to 06:00 am
On every Sunday 07:00 am to 08:00 am
On every Wednesday 08:00 am to 09:00 am

For the above condition how can i frame the RRULE.

Assist me. Thank you.
7/5/2006 4:24 PM | Ganeshgopu
Gravatar

# WebDAV 403 Error on PUT

I am trying to send emails using VB with WebDAV and an Exchange Server from multiple email addresses.

My problem is that the user accounts are on multiple servers, when I specify the server explicitly, sending the email works perfectly, but when I try to use the "higher-level" server I get a 403 Error on the PUT method.

My code is available at http://sivic.homelinux.net:81/~kevin/SendEmails.txt

Any help or ideas would be much appreciated, thank you!
7/6/2006 10:09 PM | Kevin72594
Gravatar

# re: WebDAV How, What and Problems...

"From"() is a read only property in exchange so you'll always get a 403 forbiden when trying to set it.

the way to send a same mail from different accounts is to log into every account and send it from there.
Sorry... i've cursed that too :))

Or did i misunderstood your problem?
7/6/2006 11:28 PM | Mladen
Gravatar

# WebDAV 403 Error on PUT

Mladen, thanks for your response!

I believe that you misunderstood my problem though.

Here is the situation, I am running a script from multiple email accounts, I get their login and password from them as input, therefore I do not have to set the From property. Then when I send the e-mail it gives me the 403 when I am using the top-level server.

I am not sure exactly how the servers are set up, but I will tell you what I know and maybe you can figure it out from there.

If I want to login to exchange with the web frontend I need to go to the "server1" server, just like everyone else at the company.
But if I want to send email from outlook I need to set my profile to point to "server2" while others need to set their profile to "server3".

So what I am trying to accomplish is to be able to send email from anyones address at the company without knowing if they use "server2" or "server3".

If anyone has any ideas it would be quite helpful!

TIA
Kevin
7/7/2006 2:31 PM | Kevin72594
Gravatar

# re: WebDAV How, What and Problems...

wow... that's a complex setup...
i guess you could create some sort of mapping file to use for server...
other than that.... change the exchange server setup :))
7/7/2006 3:07 PM | Mladen
Gravatar

# WebDAV 403 Error on PUT

MLaden, I was afraid you'd say that :(

Well, thanks for the help anyways!! I'm gonna have to figure out some way around it now I guess

Thanks

Kevin
7/7/2006 3:52 PM | Kevin72594
Gravatar

# re: WebDAV How, What and Problems...

I have this problem of sending meeting request using webdav in c#. whenever i create a meeting request it is created fine but the start and end time are increased by twohours. i mean that if the start time is 1:00 PM it will make it 3:00 PM andsmae goes for end date. can any body help. can anybody help?
7/27/2006 3:21 PM | zille
Gravatar

# re: WebDAV How, What and Problems...

you probably use datetime.now?
you must use datetime.UTCnow

that's because all dates in exchange are stored in utc date format and they get converted to your timezone by the client (outlook, etc...)
7/27/2006 3:23 PM | Mladen
Gravatar

# re: WebDAV How, What and Problems...

Is there any way to capture update, save, delete events in an outlook calendar item using WebDav? In particular using WebDav Event Sinks?
8/3/2006 12:11 PM | Westwood
Gravatar

# re: WebDAV How, What and Problems...

I have no idea. sorry...
8/3/2006 12:58 PM | Mladen
Gravatar

# re: WebDAV How, What and Problems...

Can you pls provide the sample code to Accept or Decline a particular Appointment.
8/7/2006 12:24 PM | Ritesh Shah
Gravatar

# re: WebDAV How, What and Problems...

Can you provide the Content Class property to retrieve a GUID of a calendar or any other mail item. i.e. something along the lines of DAV:uid.

I need the item GUID not any other exchange id, thanks.
8/10/2006 12:14 PM | Westwood
Gravatar

# re: WebDAV How, What and Problems...

There's no such thing as item GUID as far as i know.
dav:uid is the id of it...
8/10/2006 12:22 PM | Mladen
Gravatar

# re: WebDAV How, What and Problems...

Hi,

I have put an OnSave event sink on an Exchange Sent Items folder to notify me when new Sent Items are recieved in the folder, but there is a problem with this as the OnSave Event Sink does not trigger when a new Sent Item arrives.

Therefore is there anyway of the OnSave Event Sink getting triggered when new Sent Items arrive? Or do I need to use another type of Event Sink, please advise.

Thank you.
9/1/2006 10:28 AM | Robert
Gravatar

# re: WebDAV How, What and Problems...

I haven't worked with event sinks in exchange that much so my honest answer would be: i don't know.
sorry.
9/1/2006 10:39 AM | Mladen
Gravatar

# re: WebDAV How, What and Problems..."(500) Internal Server Error"

Great Article..
I have question..

I am using WebDAV to update exhange calendar appointments. But when i use it to update an appointment it returns "(500) Internal Server Error"

I checked the code and found that if length of HTML body of appintment in <mail:htmldescription> tag is huge then it return this error. If i reduce the size of HTML text then it works well.

Any idea on size limit allowed here? and how to correct this?

Any help is appreciated.

Thanks in advance.
9/8/2006 4:44 PM | MDS
Gravatar

# re: WebDAV How, What and Problems...

Check the inner http exception that you get in your catch block.

i don't know how much is the size limit.
what kind of html are you putting in theree that's so big anyway? maybe you should reconsider that.
9/8/2006 5:59 PM | Mladen
Gravatar

# re: WebDAV How, What and Problems...

I'm creating meeting
requests using WebDAV, based on the Microsoft knowledge base article #308373
(http://support.microsoft.com/default.aspx?scid=kb;EN-US;q308373), but it
must have something missing.

I run the example (I changed MSXML.XMLHTTPRequest into MSXML2.XMLHTTP40),
the appointment is created and the meeting request is sent. When the other
user accepts the meeting from Outlook Web Access, his response is sent to
me. The problem is that when I read and delete his response (now I'm using
Outlook 2000), the associated appointment is deleted as well! Of course that
doesn't happen if the meeting request is generated from Outlook 2000.
9/11/2006 6:15 PM | J Collins
Gravatar

# re: WebDAV How, What and Problems...

Items don't acctually get deleted, their just changes.
So take Exchange Explorer (in the Exchange SDK)
and see what properties are being set and when.
Basicaly track the the meeting request.

Also there are some synchronization issues with OWA and Outlook 2000.
Sometimes it happened that i had to wait a few hours until they synchronized with eachother... i have no idea why though.
9/11/2006 6:31 PM | Mladen
Gravatar

# re: WebDAV How, What and Problems...

Thanks for that - I'll give it a go
9/13/2006 10:34 AM | John Collins
Gravatar

# re: WebDAV How, What and Problems...

Hi,
I am having problem with Sending Appointment Response & Meeting Request Response.

u touch some thing realted to this , but it is not clear.
Could u please elloborate more on Meeting Response.

now I am using plain email response , Accepted OR Ten etc.

our application is handle SMS Response.

My Question is :
1. What is the exact WebDAV Format to send the Response
2. Method Propatch ??

Please send Reply As Soon As Possible

Kones
9/14/2006 6:42 AM | Koneswaran
Gravatar

# re: WebDAV How, What and Problems...

What exactly is not clear?
The person that creates an appointment sends out meeting requests to people that should attend his meeting (appointment).
those invited peopele get an email to confirm their attendance.
when they reply, by pressing an attending status (accept, deny, tentative) option, you get a mail for each person's reply. That is the meeting request reply.

Now to get an appointment that goes with that meeting request reply you must look at the property i described in
"Development problems and bugs" point 3 of this article.

If that doesn't answer your question you'll have to provide me with more info.
9/14/2006 10:50 AM | Mladen
Gravatar

# re: WebDAV How, What and Problems...

No matter what I try, I can't seem to get the same response for the well known exchange folder names as you.

What method, URI are you using to send the request?
9/15/2006 6:14 AM | jba
Gravatar

# re: WebDAV How, What and Problems...

You have to send the request xml i posted at the end of the article and use PROPFIND on the
http://servername/Exchange/username URI.

If this still doesn't work for you then post here your xml request and code.
9/15/2006 10:22 AM | Mladen
Gravatar

# re: WebDAV How, What and Problems...

I am trying to create and send meeting requests using webdav. I have to send meeting requests from different users mailboxes. In order to that I created a generic username/password and gave it full rights to the calendars of the intended users. My problem is that I am able to create and send them from only one of the user's mailbox, it is not working for any of the others. Everything is the same except for mailbox, and it is working for one mailbox and not for others. Any ideas what the problem might be? Is there some property that needs to be set for each mailbox or something?

I would appreciate if you could reply ASAP to this.

Thanks.
9/15/2006 7:15 PM | sgupta
Gravatar

# re: WebDAV How, What and Problems...

Is this ASAP enough? :))

there is no such proeprty to set.
you have to log onto each mailbox separatly and send meeting requests.

WebDav supports only operations on one mailbox at a time.
9/15/2006 7:21 PM | Mladen
Gravatar

# re: WebDAV How, What and Problems...

mladen,

Could you tell me why the HTTP REQUEST object in webdav fails the first time?

If I run the same method again it is ok but does not work the first time.

thanks,

john
9/18/2006 12:39 PM | john
Gravatar

# re: WebDAV How, What and Problems...

What error do you get? How does it fail?
9/18/2006 1:27 PM | Mladen
Gravatar

# re: WebDAV How, What and Problems...

just a http request error i.e. 404 just the first time.
9/18/2006 1:28 PM |
Gravatar

# re: WebDAV How, What and Problems...

hmm... interesting...
do you maybe have a firewall or something similar that requires a ping to open the port?

Does it happen on your development or/and production server?
9/18/2006 1:31 PM | Mladen
Gravatar

# re: WebDAV How, What and Problems...

sorry i meant a 400 bad request error.
9/18/2006 1:31 PM |
Gravatar

# re: WebDAV How, What and Problems...

mail me so we don't flood the comments here :)
9/18/2006 1:35 PM | Mladen
Gravatar

# re: WebDAV How, What and Problems...

My web method fails on the first attempt only generating a 400 bad request error. When I re-run the web method it works fine.

Any reason why the web method would fail the first time?

Note that this happens on the 'post' request of the web method.
9/18/2006 4:24 PM |
Gravatar

# re: WebDAV How, What and Problems...

No reason that i can think of...
what does your inner exception say?
9/18/2006 4:27 PM | Mladen
Gravatar

# re: WebDAV How, What and Problems...

Its OK, you obviously dont know much about my problem or much about WebDav.

Maybe I can teach you a thing or two.
9/18/2006 5:39 PM |
Gravatar

# re: WebDAV How, What and Problems...

well i'm always open for learning more... :)

Good luck with your problem.
9/19/2006 10:33 AM | Mladen
Gravatar

# re: WebDAV How, What and Problems...

What i don't get is why do you keep asking me questions when you think you know more about it than me
john/carlos/Unindentifed comment poster?
you all come from the same IP and i'm not convinced it's a conincidence. :))

I'm also very tempted to delete all of your comments... but i won't do that just yet...
9/19/2006 1:37 PM | Mladen
Gravatar

# re: WebDAV How, What and Problems...

Hello,

I am trying to create task in exchange oulook, while i am creating the task it creates task in oulook web access with all properties but there is a problem with dates i am unable to set the dates, please help me for this.
Here is the code which i am using through webdav

using System;
using System.Collections.Generic;
using System.Text;
using System.Net;

namespace CreatingTasks
{
class Program
{
static void Main(string[] args)
{
string strExchSvrName = "";
string strMailbox = "";
string strCalendarUri = "";
string strApptItem = "";
string strDomain = "";
string strUserName = "";
string strPassword = "";
string strApptRequest = "";
string strMailInfo = "";
string strCalInfo = "";
string strXMLNSInfo = "";
string strHeaderInfo = "";
System.Net.HttpWebRequest PROPPATCHRequest = null;
System.Net.WebResponse PROPPATCHResponse = null;
System.Net.CredentialCache MyCredentialCache = null;
byte[] bytes = null;
System.IO.Stream PROPPATCHRequestStream = null;

try
{
// Exchange server name;
strExchSvrName = "Servername";

// Mailbox folder name.
strMailbox = "testine.testinedotti";

// Appointment item.
strApptItem = "testappointment123.eml";

// URI of the user's calendar folder.
strCalendarUri = "http://" + strExchSvrName + "/exchange/"
+ strMailbox + "/Oppgaver/";

// User name and password of appointment creator.
strUserName = "username";
strDomain = "Domain";
strPassword = "Password";



strApptRequest = "<?xml version=\"1.0\"?>" +
"<d:propertyupdate xmlns:d=\"DAV:\" "+
"xmlns:e=\"http://schemas.microsoft.com/exchange/\" "+
"xmlns:b=\"urn:uuid:c2f41010-65b3-11d1-a29f-00aa00c14882/\" " +
"xmlns:f=\"urn:schemas:mailheader:\" " +
"xmlns:g=\"urn:schemas:httpmail:\" " +
"xmlns:h=\"http://schemas.microsoft.com/mapi/id/" +
"{00062003-0000-0000-C000-000000000046}/\"><d:set><d:prop>" +
"<d:contentclass>urn:content-classes:task</d:contentclass>" +
"<e:outlookmessageclass>IPM.Task</e:outlookmessageclass>" +
"<f:subject>This is a test-task new</f:subject>" +
"<g:textdescription>Body-Text goes here</g:textdescription>" +
"<h:0x00008102 b:dt=\"float\">.25</h:0x00008102>" +
"<h:0x00008101 b:dt=\"int\">1</h:0x00008101>" +
//"<h:0x00008517 b:dt=\"dateTime.tz\">2006-09-04T19:00:00.00Z</h:0x00008517>" +
"<h:0x00008104 b:dt=\"dateTime.tz\">2006-09-04T19:30:00.00Z</h:0x00008104>" +
//"<h:0x00008105>2006-09-20</h:0x00008105>" +
//"<h:0x00008104 b:dt=\"dateTime.tz\">2006-09-19T13:00:00.00Z</h:0x00008104>" +
//"<h:0x00008105 b:dt=\"dateTime.tz\">2006-09-20T13:30:00.00Z</h:0x00008105>" +
//// "<h:0x8105 b:dt=\"dateTime.tz\">2006-09-13T19:30:00.00Z</h:0x8105>" +
////"<h:0x8517 b:dt=\"dateTime.tz\">2006-09-12T19:30:00.00Z</h:0x8517>" +
////"<h:0x811C dt:dt=\"boolean\">0</h:0x811C>"+
////"<h:0x8101 dt:dt=\"int\">0</h:0x8101>"+
////"<h:0x8102 dt:dt=\"float\">0</h:0x8102>"+
////"<i:0x8503 dt:dt=\"boolean\">1</i:0x8503>"+
"</d:prop></d:set></d:propertyupdate>";



// Create a new CredentialCache object and fill it with the network
// credentials required to access the server.
MyCredentialCache = new System.Net.CredentialCache();
MyCredentialCache.Add(new System.Uri(strCalendarUri),
"NTLM",
new System.Net.NetworkCredential(strUserName, strPassword, strDomain)
);

// Create the HttpWebRequest object.
PROPPATCHRequest = (System.Net.HttpWebRequest)HttpWebRequest.Create(strCalendarUri + strApptItem);

// Add the network credentials to the request.
PROPPATCHRequest.Credentials = MyCredentialCache;

// Specify the PROPPATCH method.
PROPPATCHRequest.Method = "PROPPATCH";

// Encode the body using UTF-8.
bytes = Encoding.UTF8.GetBytes((string)strApptRequest);

// Set the content header length. This must be
// done before writing data to the request stream.
PROPPATCHRequest.ContentLength = bytes.Length;

// Get a reference to the request stream.
PROPPATCHRequestStream = PROPPATCHRequest.GetRequestStream();

// Write the message body to the request stream.
PROPPATCHRequestStream.Write(bytes, 0, bytes.Length);

// Close the Stream object to release the connection
// for further use.
PROPPATCHRequestStream.Close();

// Set the content type header.
PROPPATCHRequest.ContentType = "text/xml";

// Create the appointment in the Calendar folder of the
// user's mailbox.
PROPPATCHResponse = (System.Net.HttpWebResponse)PROPPATCHRequest.GetResponse();

// Clean up.
PROPPATCHResponse.Close();

Console.WriteLine("Appointment successfully created.");

}
catch (Exception ex)
{
// Catch any exceptions. Any error codes from the PROPPATCH
// method request on the server will be caught
// here, also.
Console.WriteLine(ex.Message);
}

}
}
}

Please help me to set the outlook task dates through webdav

9/21/2006 11:13 AM | Rameshwar Sharma
Gravatar

# re: WebDAV How, What and Problems...

Define "Unable to set the dates".
What does that mean exactly.
Dates in exchange have to be set in UTC time. That's because the mail client (outlook, OWA) sets the dates according to users computer timezone.
9/21/2006 11:43 AM | Mladen
Gravatar

# re: WebDAV How, What and Problems...

No,
I have done the code for dates like start date and Due date for task as u can see in my code which i have posted priviously but that dates are not showing into task window what should i do, can u please tell how to retrive task items using webdav as like calender
9/21/2006 1:30 PM | Rameshwar Sharma
Gravatar

# re: WebDAV How, What and Problems...

These are the properties which i am setting for task,

strApptRequest = "<?xml version=\"1.0\"?>" +
"<d:propertyupdate xmlns:d=\"DAV:\" "+
"xmlns:e=\"http://schemas.microsoft.com/exchange/\" "+
"xmlns:b=\"urn:uuid:c2f41010-65b3-11d1-a29f-00aa00c14882/\" " +
"xmlns:f=\"urn:schemas:mailheader:\" " +
"xmlns:g=\"urn:schemas:httpmail:\" " +
"xmlns:h=\"http://schemas.microsoft.com/mapi/id/" +
"{00062003-0000-0000-C000-000000000046}/\"><d:set><d:prop>" +
"<d:contentclass>urn:content-classes:task</d:contentclass>" +
"<e:outlookmessageclass>IPM.Task</e:outlookmessageclass>" +
"<f:subject>This is a test-task new</f:subject>" +
"<g:textdescription>Body-Text goes here</g:textdescription>" +
"<h:0x00008102 b:dt=\"float\">.25</h:0x00008102>" +
"<h:0x00008101 b:dt=\"int\">1</h:0x00008101>" +
"<h:0x00008104 b:dt=\"dateTime.tz\">2006-09-04T19:30:00.00Z</h:0x00008104>" +
"<h:0x00008105 b:dt=\"dateTime.tz\">2006-09-04T19:30:00.00Z</h:0x00008105>" +
"</d:prop></d:set></d:propertyupdate>";

It is showing subject,priority,percent completed but its not showing Start date and Due Date in Task window. Pleas help
9/21/2006 1:40 PM | Rameshwar Sharma
Gravatar

# re: WebDAV How, What and Problems...

Hmm interesting...
try removing b:dt=\"dateTime.tz\" from your date properties.
also look at your created task with Exchange explorer to see what properties it has set.
Also set the due date property in the Outlook and see what property gets set to what value with Exchange explorer.
Because your xml looks ok to me, so i can't say why i doesn't set the dates.
9/21/2006 2:16 PM | Mladen
Gravatar

# re: WebDAV How, What and Problems...

Thanks for your support, but after removing b:dt=\"dateTime.tz\" this its also not set the dates, when i am looking the Task window. I think i have to see all the fields from exchange outlook task programmatically so that i can make sure that dates are created but only it is not showing into front end, so can u please send me the code for retrieving the outlook task from Exchange server progammatically usig WebDav in C#.
9/21/2006 4:05 PM | Rameshwar Sharma
Gravatar

# re: WebDAV How, What and Problems...

i don't have any code for tasks at the moment. i only needed calendar stuff and emails.
so it might take a while... when i get some free time to play with this again...
9/22/2006 11:02 AM | Mladen
Gravatar

# re: WebDAV How, What and Problems...

Hello,

I'm trying to update (propose a new time) appointments that I have previously created by using the meeting request prosedure.

If I do it as an organizer my appointment is updated and new meeting requests are send to recipients. After they accept the request the appointments are updated in the recipients calendar.

If I try to update appointment as a recipient my appointment is updated and the organizer gets the new meeting request but when the organizer tries to accept the request comes a message that "you are the organizer you dont't have to answer the request" and the appointment is not updated.

Is there any chance to get this work? How can I propose a new time for appointment using webdav?
9/26/2006 1:05 PM | JR
Gravatar

# re: WebDAV How, What and Problems...

the original organizer doesn't have to do anything with the meeting request if the time in the organizers appointment gets updated properly.

if not then you have to get the
appointment with the
property described in
"Development problems and bugs" in point 3
that connects the appointment and meeting request reply with sql search or propfind and proppatch that appointment in the organizers calendar with proper credentials.
9/26/2006 1:41 PM | Mladen
Gravatar

# re: WebDAV How, What and Problems...

I have turned off the responserequest properties so that when the user "accepts" the request the appointment is saved to calendar and no reply is send.
9/26/2006 1:50 PM | JR
Gravatar

# re: WebDAV How, What and Problems...

Great! :)
Nice to know.
9/26/2006 1:52 PM | Mladen
Gravatar

# re: WebDAV How, What and Problems...

...But the problem still exists if the original recipient tries to update. Do you know anything about proposing a new time for appointment.

If you do appointment/meeting request in Outlook the recipient has chance to propose a new time.
9/26/2006 1:56 PM | JR
Gravatar

# re: WebDAV How, What and Problems...

I know how to disable that option but that's about it.
Never had to use it, especially with webdav.
9/26/2006 3:03 PM | Mladen
Gravatar

# re: WebDAV How, What and Problems...

It works with:
"<h:0x00008104 b:dt=\"dateTime.tz\">2006-09-28T13:00:00.000Z</h:0x00008104>" "<h:0x00008105 b:dt=\"dateTime.tz\">2006-09-28T17:30:00.000Z</h:0x00008105>"
9/28/2006 4:27 PM | Mizi
Gravatar

# re: WebDAV How, What and Problems...

Hi,

I would like to retrieve attendee details of an Exchange Calendar item.

Currently I can retrieve the attendee list using WebDav for attendees who have the 'Send Meeting To Attendee' option against them, but cannot retrieve the Attendee data when the 'Dont Send Meeting To This Attendee' option is selected against that particular attendee.

I am using the following WebDav Exchange properties to retrieve to attendee for which the 'Send Meeting To Attendee' item option has been selected. Note that the following returns both the e-mail address and attendee display names.

urn:schemas:mailheader:to
http://schemas.microsoft.com/mapi/proptag/0x0E04001E

My question is do you know of any property (possibly mapi or other) which can retrieve Calendar attendees regardless of the sending option.

Many Thanks
10/3/2006 3:28 PM | Drew
Gravatar

# re: WebDAV How, What and Problems...

try
http://schemas.microsoft.com/mapi/allattendeesstring
10/3/2006 3:41 PM | Mladen
Gravatar

# re: WebDAV How, What and Problems...

Sorry that has not worked.

Any other ideas on which properties might retrieve data?
10/3/2006 3:50 PM | Drew
Gravatar

# re: WebDAV How, What and Problems...

Try
http://schemas.microsoft.com/mapi/id/{00062002-0000-0000-C000-000000000046}/0x8238
10/3/2006 3:54 PM | Mladen
Gravatar

# re: WebDAV How, What and Problems...

not that either, any more suggestions?
10/3/2006 4:04 PM | Drew
Gravatar

# re: WebDAV How, What and Problems...

http://schemas.microsoft.com/mapi/id/{00062002-0000-0000-C000-000000000046}/0x8238
is a read only property as far as i know.

Did you try both propfind and sql search?

If neither of those return them then i have no more trick up my sleeve. Sorry.
10/3/2006 4:12 PM | Mladen
Gravatar

# re: WebDAV How, What and Problems...

Yes I did do the propfind.

Anyhow thanks for trying at least you have given me an idea of what MAPI property I can use for my search. :)
10/3/2006 4:17 PM |
Gravatar

# re: WebDAV How, What and Problems...

I am using Exchange 2003 does the http://schemas.microsoft.com/mapi/id/{00062002-0000-0000-C000-000000000046}/0x8238

property exist for Exchange 2003? if not do you now the equivalent?
10/3/2006 4:20 PM | Drew
Gravatar

# re: WebDAV How, What and Problems...

Hi Mladen,

I will scrap the idea of retrieving the MAPI attendeee properties, its proving to be to complex and possibly not possible in Exchange 2003.

I instead want to retrieve the contact properties such as name, email, phone number etc of contact(s) attached to a outlook appointment.

Do you know of any WebDav properties which would allow me to do this?

I would appreciate a response.

thank you.

Drew
10/5/2006 10:33 AM | Drew
Gravatar

# re: WebDAV How, What and Problems...

Do have any idea Mladen about how to do this?

If it is possible to retrieve the Href property which points to the contact item then this property would be very useful.
10/5/2006 12:28 PM | Drew
Gravatar

# re: WebDAV How, What and Problems...

I have tried

urn:schemas:calendar:contacturl

but that does not retrieve anything

I have also used http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}/0x0000853A

but this retrieves the contact names and no other data, therefore do you know how to obtain the rest of a contacts data within the who is part of a contact within an appointment?

could you reply ASAP, thanks
10/5/2006 2:01 PM | Drew
Gravatar

# re: WebDAV How, What and Problems...

i'm out of office for one day and everthing becomes urget. :)
what is it with days like that? :)))

These are all contact properties that i know of:
Account = urn:schemas:contacts:account
AuthOrig = urn:schemas:contacts:authorig
Birthday = urn:schemas:contacts:bday
BusinessHomePage = urn:schemas:contacts:businesshomepage
CountryCode = urn:schemas:contacts:c
CallbackPhone = urn:schemas:contacts:callbackphone
Children = urn:schemas:contacts:children
ChildrensNames = urn:schemas:contacts:childrensnames
CompleteName = urn:schemas:contacts:cn
Country = urn:schemas:contacts:co
ComputerNetworkName = urn:schemas:contacts:computernetworkname
CustomerID = urn:schemas:contacts:customerid
Department = urn:schemas:contacts:department
DistinguishedName = urn:schemas:contacts:dn
Email1 = urn:schemas:contacts:email1
Email2 = urn:schemas:contacts:email2
Email3 = urn:schemas:contacts:email3
EmployeeNumber = urn:schemas:contacts:employeenumber
FacsimileTelephoneNumber = urn:schemas:contacts:facsimiletelephonenumber
FbURL = urn:schemas:contacts:fburl
FileAs = urn:schemas:contacts:fileas
FileAsID = urn:schemas:contacts:fileasid
FtpSite = urn:schemas:contacts:ftpsite
Gender = urn:schemas:contacts:gender
GeoLatitude = urn:schemas:contacts:geolatitude
GeoLongitude = urn:schemas:contacts:geolongitude
GivenName = urn:schemas:contacts:givenName
GovernmentId = urn:schemas:contacts:governmentid
Hobbies = urn:schemas:contacts:hobbies
HomeCity = urn:schemas:contacts:homeCity
HomeCountry = urn:schemas:contacts:homeCountry
HomeFax = urn:schemas:contacts:homefax
HomeLatitude = urn:schemas:contacts:homelatitude
HomeLongitude = urn:schemas:contacts:homelongitude
HomePhone = urn:schemas:contacts:homePhone
HomePhone2 = urn:schemas:contacts:homephone2
HomePostalAddress = urn:schemas:contacts:HomePostalAddress
HomePostalCode = urn:schemas:contacts:homePostalCode
HomePostOfficebox = urn:schemas:contacts:HomePostOfficebox
HomeState = urn:schemas:contacts:homeState
HomeStreet = urn:schemas:contacts:homeStreet
HomeTimezone = urn:schemas:contacts:hometimezone
Initials = urn:schemas:contacts:initials
InternationalIsdnNumber = urn:schemas:contacts:internationalisdnnumber
City = urn:schemas:contacts:l
Language = urn:schemas:contacts:language
Location = urn:schemas:contacts:location
MailingAddressId = urn:schemas:contacts:mailingaddressid
MailingCity = urn:schemas:contacts:mailingcity
MailingCountry = urn:schemas:contacts:mailingcountry
MailingPostalAddress = urn:schemas:contacts:mailingpostaladdress
MailingPostalCode = urn:schemas:contacts:mailingpostalcode
MailingPostOfficeBox = urn:schemas:contacts:mailingpostofficebox
MailingState = urn:schemas:contacts:mailingstate
MailingStreet = urn:schemas:contacts:mailingStreet
Manager = urn:schemas:contacts:manager
MapURL = urn:schemas:contacts:mapurl
Members = urn:schemas:contacts:members
MiddleName = urn:schemas:contacts:middlename
Mobile = urn:schemas:contacts:mobile
NameSuffix = urn:schemas:contacts:namesuffix
Nickname = urn:schemas:contacts:nickname
Organization = urn:schemas:contacts:o
OfficeTelephoneNumber = urn:schemas:contacts:officetelephonenumber
Office2TelephoneNumber = urn:schemas:contacts:office2telephonenumber
OrganizationMainPhone = urn:schemas:contacts:organizationmainphone
OtherCity = urn:schemas:contacts:othercity
OtherCountry = urn:schemas:contacts:othercountry
OtherCountryCode = urn:schemas:contacts:othercountrycode
OtherFax = urn:schemas:contacts:otherfax
OtherMobile = urn:schemas:contacts:othermobile
OtherPager = urn:schemas:contacts:otherpager
OtherPostalAddress = urn:schemas:contacts:otherpostaladdress
OtherPostalCode = urn:schemas:contacts:otherpostalcode
OtherPostOfficeBox = urn:schemas:contacts:otherpostofficebox
OtherState = urn:schemas:contacts:otherstate
OtherStreet = urn:schemas:contacts:otherstreet
OtherTelephone = urn:schemas:contacts:otherTelephone
OtherTimezone = urn:schemas:contacts:othertimezone
Outbox = urn:schemas:contacts:outbox
Pager = urn:schemas:contacts:pager
PersonalHomePage = urn:schemas:contacts:personalHomePage
PersonalTitle = urn:schemas:contacts:personaltitle
PostalCode = urn:schemas:contacts:postalcode
PostOfficeBox = urn:schemas:contacts:postofficebox
Profession = urn:schemas:contacts:profession
ReferredBy = urn:schemas:contacts:referredby
RoomNumber = urn:schemas:contacts:roomnumber
Secretary = urn:schemas:contacts:secretary
SecretaryCN = urn:schemas:contacts:secretarycn
SecretaryPhone = urn:schemas:contacts:secretaryphone
SecretaryURL = urn:schemas:contacts:secretaryurl
LastName = urn:schemas:contacts:sn
SourceURL = urn:schemas:contacts:sourceurl
SpouseCN = urn:schemas:contacts:spousecn
State = urn:schemas:contacts:st
Street = urn:schemas:contacts:street
SubmissionContLength = urn:schemas:contacts:submissioncontlength
TelephoneNumber = urn:schemas:contacts:telephoneNumber
TelephoneNumber2 = urn:schemas:contacts:telephonenumber2
TelexNumber = urn:schemas:contacts:telexnumber
Title = urn:schemas:contacts:title
TtytddPhone = urn:schemas:contacts:ttytddphone
UserCertificate = urn:schemas:contacts:usercertificate
WeddingAnniversary = urn:schemas:contacts:weddinganniversary
WorkAddress = urn:schemas:contacts:workaddress
10/5/2006 4:21 PM | Mladen
Gravatar

# re: WebDAV How, What and Problems...

I hope i'm not a pest ):

But I think you have misunderstood what I am trying to do, I want to be able to contact details from a contact contained within an appointment item and not in a contact item.

Im having problem in getting
the ContactUrl of the Contacts(contacts in the users contact
folder) of a particular appointment. I tried using the
namespace "urn:schemacs:calendar:contacturl" to get the contact details. But its returns nothing. Is there anyway to get the details of the contacts specified in the appointment.

I can get the contact name buts that it I cannot retireve any
further contact properties. I use the following property to get
the contact names.

http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}/0x0000853A

or I use


http://schemas.microsoft.com/mapi/contacts

Both get all the names of contact, but no further details hence
I would to if there is anyway to retrieve further details using
WebDav properties, what would be particularly useful to me would be to retrieve the contacturl, from
which I would be able to use and get any necessary contact
details I need.

Any ideas/solutions?
10/5/2006 4:34 PM | Drew
Gravatar

# re: WebDAV How, What and Problems...

Well i assume that your contact names are from people in your address book.
you could search the contacts folder with contact names with sql for your returned names.

for me it makes no sense that allcontact properties would be stored in the calendar object.

think of the contact name as a key :)

And no you're not a pest. :))
No worries.
10/5/2006 4:49 PM | Mladen
Gravatar

# re: WebDAV How, What and Problems...

Thanks ;)

The problem with that approach is that if I have many contacts with the same name then knowing which is the correct contact is not possible.

If I am able to get a few distinct properties from the calendar contact such as e-mail address, phone number etc then my SQL would return me a more unique result which is the solution that I am looking for.

Any ideas on how to get these few distinct properties?
10/5/2006 4:58 PM | Drew
Gravatar

# re: WebDAV How, What and Problems...

Hmm... i get the URL of the contact in the contactURL if the contact is in the exchange. then i can simply query the contact object with it.

I have no idea why you wouldn't be able to get it to.
Are you setting that property when you're adding the contact with webdav?
10/5/2006 5:32 PM | Mladen
Gravatar

# re: WebDAV How, What and Problems...

I dont add the contact with WebDav or add the contacturl in anyway, the scenario is that a user creates an appointment in outlook and puts in whatever data they choose, I then use WebDav to get the contact data.

I want to do exactly what you have stated which is to get the contactURL of the item and to then query the contact object using the ContactURL but I am unable to retrieve the ContactURL any ideas on how to achieve this? :)

If I am able to get the ContactURL then thats my problem sorted, just to make sure were on the same page the ContactURL property is:

urn:schemas:calendar:contacturl

Any suggestions?
10/5/2006 5:40 PM | Drew
Gravatar

# re: WebDAV How, What and Problems...

How can I set the contacturl?

If I set the contacturl then would I be able to retrieve for all appointment contacts by using the property urn:schemas:calendar:contacturl ?
10/5/2006 5:48 PM | Drew
Gravatar

# re: WebDAV How, What and Problems...

at this moment none anymore... sorry.

as i said my
urn:schemas:calendar:contacturl
is filled with contact URL's.

and i have no idea why yours doesn't get filled.
10/5/2006 5:49 PM | Mladen
Gravatar

# re: WebDAV How, What and Problems...

Thanks for trying!
10/5/2006 5:53 PM | Drew
Gravatar

# re: WebDAV How, What and Problems...

One FINAL thing.

DO I need to do use a SQL query as part of the WebDav request?

Also could you post your code as it will allow me to analyse what I am missing.

I would appreciate it very much if you could do this.

I dont want to pollute this forum with anymore posts. :)
10/5/2006 6:01 PM |
Gravatar

# re: WebDAV How, What and Problems...

There's no code really.
I just use outlook 2003
i just do select all properties from calendar like. the select statement is a simple sql as described in "search" part of this article.

and it's not a forum,
It's comments of a blog post :)))
10/5/2006 6:33 PM | Mladen
Gravatar

# re: WebDAV How, What and Problems...

Pardon me, I meant blog. :)

Do I need to use a select query?

Because at the moment I am using not using any sql in my webdav call and can retrieve all other properties that I require except the contacturl.

Also within your sequel are you using the 'DEEP' search or 'SHALLOW' search?

Could you post your contacturl result it would be interesting for me to see what the property result looks like and if it would be of use to me.
10/5/2006 6:48 PM | Drew
Gravatar

# re: WebDAV How, What and Problems...

mladen I am using an sql search, using a webdav search but I still cant seem to get the contacturl!

Could you post a snippet of you code which shows how you retrieve the contacturl from an appointment and also the result.

Can you reply to this? :)
10/6/2006 1:26 PM | Drew
Gravatar

# re: WebDAV How, What and Problems...

Hey
I won't be at work until tuesday (vacation time! :))), so i won't be able to post any code before then so if you could post a comment on monday evening or tuesday morning to remind that would be great.
10/6/2006 1:36 PM | Mladen
Gravatar

# re: WebDAV How, What and Problems...

How to upload file into exchange server outlook/public folder using WebDAV(in C#.NET).
10/9/2006 2:06 PM | Rameshwar
Gravatar

# re: WebDAV How, What and Problems...

How to set access rights to folders for perticular user, using WebDAV.
(in C#.NET)?
10/9/2006 2:11 PM |
Gravatar

# re: WebDAV How, What and Problems...

Mladen Reminder to answer my previous post.

Also I want to retrieve journal item properties which has the "urn:content-classes:activity" but I cannot find any documentation on the internet which details the webdav properties of the "urn:content-classes:activity". Do you know of properties for this class?
10/9/2006 5:00 PM | Drew
Gravatar

# re: WebDAV How, What and Problems...

Hey Drew!
thanx for the reminder.
I'll look into it tommorow when i'll be doing some work with webdav anyway.

These are the specific journal properties that i know of:
Company: http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}/0x8539
Entry Text: http://schemas.microsoft.com/mapi/id/{0006200A-0000-0000-C000-000000000046}/0x8700
StartDate: http://schemas.microsoft.com/mapi/id/{0006200A-0000-0000-C000-000000000046}/0x8706
EndDate: http://schemas.microsoft.com/mapi/id/{0006200A-0000-0000-C000-000000000046}/0x8708
Duration: http://schemas.microsoft.com/mapi/id/{0006200A-0000-0000-C000-000000000046}/0x8707
Type = http://schemas.microsoft.com/mapi/id/{0006200A-0000-0000-C000-000000000046}/0x8712

plus all other standarad DAV properties.
10/9/2006 5:26 PM | Mladen
Gravatar

# re: WebDAV How, What and Problems...

Rameshwar:
you can upload files wit PUT command.

As far as i know you can't set access rights with Webdav. If you find out that it is possible please let me know.
10/9/2006 5:27 PM | Mladen
Gravatar

# re: WebDAV How, What and Problems...

Hi Mladan,

Is there a journal property to access the contact associated with the Journal i.e. the contact url???
10/9/2006 5:55 PM |
Gravatar

# re: WebDAV How, What and Problems...

on that one i have no idea.
I've never worked with journaly in outlook or in webdav.

But now i'm curious... what are you developing? a full blown library or what? If you are i want a copy :))
10/9/2006 6:03 PM | Mladen
Gravatar

# re: WebDAV How, What and Problems...

Not quite.

But i'm trying to get an Web App to function to some degree with all e-mail items using WebDav.

Trust me its very tricky and hard work!

Remember to answer my original question.
10/9/2006 6:54 PM | Drew
Gravatar

# re: WebDAV How, What and Problems...

hi,

Can you help me somthing about masking. Suppose there is two user one has uploaded a file in a folder in public folder of exchange and i want that the other user wont be able to access that file into the first ones folder, is it possible using webdav in c#
10/10/2006 8:58 AM | Rameshwar
Gravatar

# re: WebDAV How, What and Problems...

Mladen,

Any idea on how to retrieve attachment data i.e. name, size, location for calendar (appointment) items?
10/10/2006 12:25 PM |
Gravatar

# re: WebDAV How, What and Problems...

Can you please send me the code for uploading file into exchange public folder
10/10/2006 12:45 PM | Rameshwar
Gravatar

# re: WebDAV How, What and Problems...

Rameshwar,

Try this.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wss/wss/_webdav_x-ms-enumatts.asp
10/10/2006 12:56 PM | Drew
Gravatar

# re: WebDAV How, What and Problems...

Ok, i've looked into this thing a bit.
First let's get something clear.
What do you consider a contact?
1. An appointment attendee
2. On appointment tab in outlook there's a button in the lower left corner that says contacts?

if 1. then those are people that you have in your exchange directory as users with mailboxes.
Those can't have same names (at least i'm unable to give them same names in Active Directory).
So it's either that full name or an e-mail to which you want to send a meeting request.
those can be found in these MAPI proptags:
PR_DISPLAY_BCC = "http://schemas.microsoft.com/mapi/proptag/x0e02001f"
PR_DISPLAY_CC = "http://schemas.microsoft.com/mapi/proptag/x0e03001f"
PR_DISPLAY_TO = "http://schemas.microsoft.com/mapi/proptag/x0e04001f"

if 2. then you also can't have 2 contacts with the same name there.
It'll simply show the first you choose.
about getting that info take a look at this thread:
http://groups.google.si/group/microsoft.public.exchange.admin/browse_thread/thread/7b1fb1719affa4d3/a45c1c5ce161d3b4?lnk=st&q=x800e001e&rnum=1&hl=sl#a45c1c5ce161d3b4
I'm preety much having the same issues.

Oh and DO USE OutlookSpy. It's a great tool that integrates into the Outlook.

As for urn:schemas:calendar:contacturl i'd like to thank you for finding a bug in my code.
I had some values that i usually test with still hardcoded.
When deleted i also get empty values for both fields.
10/10/2006 7:59 PM | Mladen
Gravatar

# re: WebDAV How, What and Problems...

I am trying to create a task request using WEDBAV.

I need to attach a task to the task request and set the properties for linking the task to the task request.

Has anyone tried this before
10/13/2006 11:46 AM | Rahul Singh
Gravatar

# re: WebDAV How, What and Problems...

I haven't.
10/14/2006 5:15 PM | Mladen
Gravatar

# re: WebDAV How, What and Problems...

I want to know what is the property name of the number and the names of task attachment in exchange explorer.
10/15/2006 3:06 PM | atef kabani
Gravatar

# re: WebDAV How, What and Problems...

Mladen,

Is there any simple way to send a meeting request of a calendar item using webdav i.e. simulates the 'send' button option.

I have looked at your example above but I do not want to create a copy of the item I simply want to send it and for the calendar item in my calendar folder to remain where it is.

Is there anyway to do this?
10/16/2006 1:11 PM | Drew
Gravatar

# re: WebDAV How, What and Problems...

No you have to copy the item.
Outlook does the same.

because there are 2 items. An Appointment and a meeting request.
10/16/2006 1:18 PM | Mladen
Gravatar

# re: WebDAV How, What and Problems...

OK, Have you got a short example of the WebDav COPY and Move methods?

Sorry to be a pain.
10/16/2006 1:30 PM | Drew
Gravatar

# re: WebDAV How, What and Problems...

this is my send method of the MeetingRequest class:

public override bool Send()
{
if (_Appointment == null)
throw new ArgumentNullException("_Appointment ", "Appointment must not be null.");
// save an appointment to calendar folder
_Appointment.Send();
// copy an appointment for the meeting request
Copy copy = new Copy(_Appointment.ItemURI, this.ItemURI, true);
copy.ExecuteRequest();
this.MessageClass = "IPM.Schedule.Meeting.Request";
this.ContentClass = "urn:content-classes:calendarmessage";
this.CalendarMethod = Enums.CalendarMethod.Request;
// Send a meeting request
return base.Send();
}

But don't tell anyone i've shown you this :)))

Copy is the HTTP copy method.
_Appointment is passed as an argument to the meetingrequest class.
Appointment.Send() PropPatches the appointment into the calendar folder.

MeetingRequest's send propPatches the meetingrequest into calendar folder and then move's it into the ##DavMailSubmissionURI##
10/16/2006 1:48 PM | Mladen
Gravatar

# re: WebDAV How, What and Problems...

Mladen,

That function looks very tight, but it doesn't help me. I am looking for an example piece webdav code.

Which includes the necessary xml properties fields i.e.

<?xml version="1.0"?>
<a:propfind xmlns:a="DAV:">
<a:prop><a:getcontenttype/></a:prop>
<a:prop><a:getcontentlength/></a:prop>
</a:propfind>

And to then do a webdav request send

WebDavRequest.sMethod = "PROPPATCH"
WebDavRequest.send()

Have you got some code which illustrates this? :)
10/16/2006 1:55 PM | Drew
Gravatar

# re: WebDAV How, What and Problems...

how about you send me a mail and we we do that over the mail?
10/16/2006 2:12 PM | Mladen
Gravatar

# re: WebDAV How, What and Problems...

Appointment sample's PropPatch XML: (in _Appointment.Send())
<?xml version=\"1.0\" ?>
<a:propertyupdate xmlns:a=\"DAV:\"
xmlns:n0=\"http://schemas.microsoft.com/exchange/\"
xmlns:n1=\"urn:schemas:calendar:\"
xmlns:n2=\"urn:schemas:httpmail:\"
xmlns:n3=\"urn:schemas:mailheader:\">
<a:set>
<a:prop>
<n0:outlookmessageclass>IPM.Appointment</n0:outlookmessageclass>
<a:contentclass>urn:content-classes:appointment</a:contentclass>
<n1:busystatus>BUSY</n1:busystatus>
<n1:dtend>2006-10-16T13:16:17.147Z</n1:dtend>
<n1:dtstart>2006-10-16T12:15:55.850Z</n1:dtstart>
<n2:htmldescription>Test Text</n2:htmldescription>
<n1:instancetype>0</n1:instancetype>
<n1:location>my office.</n1:location>
<n1:responserequested>1</n1:responserequested>
<n2:subject>Test Subject</n2:subject>
<n1:timezoneid>4</n1:timezoneid>
<n3:to>my@email.com</n3:to>
</a:prop>
</a:set>
</a:propertyupdate>

Meeting requests PropPatch XML:
<?xml version=\"1.0\" ?>
<a:propertyupdate xmlns:a=\"DAV:\"
xmlns:n0=\"http://schemas.microsoft.com/exchange/\"
xmlns:n1=\"urn:schemas:calendar:\" >
<a:set>
<a:prop>
<n0:outlookmessageclass>IPM.Schedule.Meeting.Request</n0:outlookmessageclass>
<a:contentclass>urn:content-classes:calendarmessage</a:contentclass>
<n1:method>REQUEST</n1:method>
</a:prop>
</a:set>
</a:propertyupdate>

and then the metting request gets moved to ##DavMailSubmissionURI##

Will that do?
10/16/2006 2:26 PM | Mladen
Gravatar

# re: WebDAV How, What and Problems...

Thanks Mladen,

I should get everything working now, but could you just elaborate (code) on how to get the PUTS method working for sending attachments.


This should be it for today ;).
10/16/2006 3:41 PM | Drew
Gravatar

# re: WebDAV How, What and Problems...

you set the PUT's URI to the itemUri of your item and for body you put the byte array byte[] of your attachment.
10/16/2006 3:57 PM | Mladen
Gravatar

# re: WebDAV How, What and Problems...

Mladen,

you dont need to attach the attachments using PUT.

Simply sending the meeting request automatically attaches the attachments :)

Am I missing something or am I correct?
10/16/2006 5:12 PM |
Gravatar

# re: WebDAV How, What and Problems...

you have to put the attachment to the meeting request before you move it to the ##davsubmissionURI##.
PUT simply uploads the attachment.
10/17/2006 10:52 AM | Mladen
Gravatar

# re: WebDAV How, What and Problems...

Mladen,

When I create a copy of the original calendar item to send a meeting request it is sent correctly to all attendees but the meeting request is deleted (copied calendar item) from my calendar item.

Therefore when an attendee accepts/declines an appointment an email is recieved by me but no calendar item is updated with the tracking information as the calendar item no longers exists becuase it was sent.

Any ideas on how to get past this problem?

I have followed the steps you suggested above.

All I want to do is send a meeting request as you normally do through webdav and for the tracking bar to appear to track responses....
10/17/2006 12:16 PM | Drew
Gravatar

# re: WebDAV How, What and Problems...

Mladen,

Thanks I already know about the resource.

The resource however does not discuss sending meeting cancellations through WebDav.

Do you have any idea how to do this?
10/18/2006 11:27 AM | Drew
Gravatar

# re: WebDAV How, What and Problems...

to cancel a meeting request you need to set
- http://schemas.microsoft.com/exchange/outlookmessageclass to "IPM.Schedule.Meeting.Canceled"
- DAV:contentclass to "urn:content-classes:calendarmessage" - urn:schemas:calendar:method to "CANCEL"

and send the meeting requsest update.
10/18/2006 11:37 AM | Mladen
Gravatar

# re: WebDAV How, What and Problems...

Success!

Thanks Mladen, that has worked perfectly, nice one :)
10/18/2006 6:46 PM | Drew
Gravatar

# re: WebDAV How, What and Problems...

Well i'm glad i could help out.
10/19/2006 10:19 AM | Mladen
Gravatar

# re: WebDAV How, What and Problems...

Mladen
Yes you did a good job.

Now I only need to work out how to send a meeting request which sends out the original item as a meeting request (as is done normally through outlook).

Final hurdle. --- __ --- ___ ---
10/19/2006 12:41 PM | Drew
Gravatar

# re: WebDAV How, What and Problems...

emmm... care to elaborate a bit more?
10/19/2006 1:32 PM | Mladen
Gravatar

# re: WebDAV How, What and Problems...

Mladen,

Well when you send a meeting request through outlook you simply click the 'send' button, this sends a meeting request to the attendee(s) and a 'tracking' bar is created in the item.

Te attendee responds and the meeting request in the organizers mail is updated with the attendee(s) response.

NO emails are sent or recieved, everthing is kept neat.

All I want to do is replicate the above functionality in webdav.

Any ideas?
10/19/2006 1:55 PM |
Gravatar

# re: WebDAV How, What and Problems...

Well i don't know the property URI that holds tracking info. if you find out do let me know.

Well when you receive the meeting request reply you can get the appointment in your caledar that is associated with the meeting request's reply with athe property described in "Development problems and bugs" point 3 of this article.

then you can update the appropriate appointment in your calendar with the tracking info.
Outlook does the same i just don't know which properties get set.
And i don't really have time at the moment to dig into this.

I still want a look at your app once it's finished. :)
10/19/2006 2:08 PM | Mladen
Gravatar

# re: WebDAV How, What and Problems...

Mladen,

One final thing.

Is it possible to send a mail item using another mailbox location other then '##DavMailSubmissionURI##'? because this mailbox location is my problem as it deletes the calendar item.

Is it possible to use another mailbox location which does not delete the calendar item? as I believe that this will be the solution to my problem.

No more questions on this, I promise :)
10/19/2006 3:26 PM | Drew
Gravatar

# re: WebDAV How, What and Problems...

Not that i'm aware of.
##DavMailSubmissionURI## is the folder for webdav to send mail.

What do you mean it gets deleted from your calendar??
which item?
An appointment for meeting request??

That shouldn't be happening.
10/19/2006 3:28 PM | Mladen
Gravatar

# re: WebDAV How, What and Problems...

For example say that I dont want to create a copy of the calendar item I just want to send the meeting request of the item, then sending the meeting request of the calendar item using the '##DavMailSubmissionURI##' removes the item (meeting request) from my calendar.

Should this be happening?

This is the absoloute last hurdle to the solution i'm implementing and WebDav always finds a way of screwing it up for me..argggh...
10/19/2006 3:39 PM | Drew
Gravatar

# re: WebDAV How, What and Problems...

I've had a carefull look and its a temporary delete the calendar item is restored.

But still no way to link the response to the calendar item.
10/19/2006 3:59 PM | Drew
Gravatar

# re: WebDAV How, What and Problems...

take a look at
Development problems and bugs
3. Getting associated appointment from a meeting request reply

in this article.
10/19/2006 4:00 PM | Mladen
Gravatar

# re: WebDAV How, What and Problems...

Using that property is inefficient as it would require a search to find all items with the matching property and to then do an update, which is not the solution i'm looking.

All I want is the 'send' operation to be replicated in webdav, which at this point in time looks impossible.

Anyhow thanks for trying.
10/19/2006 4:47 PM | Drew
Gravatar

# re: WebDAV How, What and Problems...

if you find any other way of doing this please let me know.
10/19/2006 4:49 PM | Mladen
Gravatar

# re: WebDAV How, What and Problems...

Mladen,

I've cracked it.

To set the 'Tracking' bar on the original calendar item from which a meeting request has been generated simply set the

'http://schemas.microsoft.com/mapi/finvited'

property to '1' this will bring up the tracking bar and will capture all the respones made by all attendees although for some reason you need to view the e-mail response of the attendee first in your inbox before your calendar item is updated with the attendee response.

Well there it is, something so simple can be so difficult to find out about.

Happy programming :)
10/20/2006 12:42 PM | Drew
Gravatar

# re: WebDAV How, What and Problems...

Thanx man.
Yeah i nthe end everything looks simple enough :))

So when can i expect to see your app? :)
10/20/2006 1:10 PM | Mladen
Gravatar

# re: WebDAV How, What and Problems...

Not quite yet.

Some time in the near future.

I will let you know. :)
10/20/2006 1:54 PM | Drew
Gravatar

# re: WebDAV How, What and Problems...

Mladen,

I've got a bug which i'm having trouble with.

When I save an attendee manually to a calendar item in outlook and I send a meeting request through webdav I get confirmation e-mails but when I save an attendee through webdav and I send a meeting request through webdav, I do not get the confirmation e-mails in my inbox.

Do you know why this is?

and how can i resolve this?
10/20/2006 4:23 PM | Drew
Gravatar

# re: WebDAV How, What and Problems...

There must a property which is set when the 'Save/Close' button is clicked in Outlook.

Do you know what this property might be? and what value it should hold?

A quick response will be appreciated.
10/20/2006 4:36 PM | Drew
Gravatar

# re: WebDAV How, What and Problems...

i have no idea which property gets saved.

In times like these i turn to outlook spy and compare the properties from both items.

Have fun, i'm going home :)
10/20/2006 4:38 PM | Mladen
Gravatar

# re: WebDAV How, What and Problems...

if you do find out then let me know.
10/20/2006 5:19 PM | Drew
Gravatar

# re: WebDAV How, What and Problems...

this is an interesting KB article that might be of use:
http://support.microsoft.com/kb/899919
10/23/2006 5:25 PM | Mladen
Gravatar

# re: WebDAV How, What and Problems...

Mladen,

I am still stuck on my previous problem, therefore could please answer the following questions for me.

What properties do you set to save and send a meeting request (please list both the original appointment properties that you set and the meeting request properties)?

And do you recieve a confirmation e-mail from the attendee when they respond?

Cheers,
10/25/2006 11:07 AM | Drew
Gravatar

# re: WebDAV How, What and Problems...

No Problem Mladen,

Its sorted.
10/25/2006 4:21 PM | Drew
Gravatar

# re: WebDAV How, What and Problems...

Hi

I am using WebDAV to add appointments to shared calendars but get a 403 (forbidden error). When I change the status from BUSY to FREE then I no longer get the error or if I set an appointment in the past i.e. last year then I do not get this error. Apparently this is due to some Microsoft security update. Does anyone know of a workaround?

TIA
RS
2/22/2007 6:41 PM | RS
Gravatar

# re: WebDAV How, What and Problems...

unfortunatly i have no idea.
2/23/2007 2:04 PM | Mladen
Gravatar

# re: WebDAV How, What and Problems...

I want to save a file in the drafts folder on exchange server. I have got everything from the link
http://msdn2.microsoft.com/en-us/library/ms876357.aspx
except the way to upload attachments to it. U have talked about sending the itemUri. Can u plz post the code for that.
I am working on Asp.Net using c#
3/17/2007 11:52 AM | anjali
Gravatar

# re: WebDAV How, What and Problems...

Hi Mladen,

I am new here and have read the entire thread, but haven't been able to sort something out. Perhaps it has been resolved, but I couldn't find it here. My problem is with setting the Due date and Reminder for a Task using webdav.

I have used the code which is commonly available:
xmlstr = "<?xml version=""1.0""?>" & _
"<d:propertyupdate xmlns:d='DAV:' " & _
"xmlns:e='http://schemas.microsoft.com/exchange/' " & _
"xmlns:b='urn:uuid:c2f41010-65b3-11d1-a29f-00aa00c14882/'" & _
"xmlns:f='urn:schemas:mailheader:' " & _
"xmlns:g='urn:schemas:httpmail:'" & _
"xmlns:h='http://schemas.microsoft.com/mapi/id/{00062003-0000-0000-C000-000000000046}/'" & _
"xmlns:i='http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}/'>" & _
"<d:set>" & _
"<d:prop>" & _
"<d:contentclass>urn:content-classes:task</d:contentclass>" & _
"<e:outlookmessageclass>IPM.Task</e:outlookmessageclass>" & _
"<e:x-priority-long b:dt=""int"">1</e:x-priority-long> " & _
"<h:0x00008104 b:dt='dateTime.tz'>2005-09-27T00:00:00Z</h:0x00008104>" & _
"<h:0x00008105 b:dt='dateTime.tz'>2005-09-27T00:00:00Z</h:0x00008105>" & _
"<h:0x0000811C b:dt='boolean'>0</h:0x0000811C>" & _
"<h:0x00008101 b:dt='int'>0</h:0x00008101>" & _
"<h:0x00008102 b:dt='float'>0</h:0x00008102>" & _
"<i:0x00008503 b:dt='boolean'>1</i:0x00008503>" & _
"<i:0x00008502 b:dt='dateTime.tz'>2005-09-26T00:00:00Z</i:0x00008502>" & _
"<i:0x00008560 b:dt='dateTime.tz'>2005-09-26T00:00:00Z</i:0x00008560>" & _
"<f:subject>Test1234</f:subject>" & _
"<f:htmldescription>Fix this</f:htmldescription> " & _
"</d:prop>" & _
"</d:set>" & _
"</d:propertyupdate>"

and other variations, but without success. What am I missing? I read somewhere that 0x00008104 is for Start date, 0x0000810f is for End date, and 0x00008105 for Due date. But when I send this over ( I also pass my exchange server name and mailbox), I get 400 Bad request errors. If I take the h and i tags, the Task gets created fine, but without those properties.
Any ideas?

Thanks a lot in advance.
3/20/2007 6:33 PM | Maria
Gravatar

# re: WebDAV How, What and Problems...

Mladen,

Never mind. I just found out what the issue was. I wasn't paying attention to the my error codes, and was getting the error on different line than what I thought.
3/20/2007 8:49 PM | Maria
Gravatar

# re: WebDAV How, What and Problems...

Hi, interesting page but mostly way above my head! I'm debugging a problem where WebDAV is called from a VBScript to find a property of a mailbox, the meat of the query is this:
<?xml version="1.0"?><a:propfind xmlns:a="DAV:" xmlns:d="urn:schemas:httpmail:"><a:prop><d:inbox/></a:prop></a:propfind>
however it always returns 404 Resource Not Found. The script starts the query off with:
req.open "PROPFIND", url, false
where the "url" variable is in the form http://servername/exchange/mailbox/ - but it doesn't matter which mailbox I try
The script is from microsoft, its actually the Auto Accept Agent, so I'm sure its coded right (!) but I don't know why Exchange is failing to respond - have you come across this before?
Much appreciated,
4/2/2007 7:06 PM | JohnnyB
Gravatar

# re: WebDAV How, What and Problems...

do you have HTTP access enabled on the exchange server?
4/2/2007 7:21 PM | Mladen
Gravatar

# re: WebDAV How, What and Problems...

Hi Mladen,

my issue is how to update Appointment by adding more attendees and only send appointment to who have just added
if that Appointment cancels it will inform to all attendees :(
4/4/2007 6:03 AM | Huylt
Gravatar

# re: WebDAV How, What and Problems...

Hi Mladen,

i can not update Appointemt by adding more attendees
4/5/2007 12:31 PM | Huylt
Gravatar

# WebDAV How, What and Problems...

You've been kicked (a good thing) - Trackback from DotNetKicks.com
4/9/2007 5:39 PM | DotNetKicks.com
Gravatar

# re: WebDAV How, What and Problems...

does anybody know how can I have multiple lines in the htmldescription? I tried to embed a html string there, like
<html><body>line1<br>line2</body></html>

then my appointment text just shows blank

thanks
4/18/2007 5:41 AM | Emp
Gravatar

# re: WebDAV How, What and Problems...

you can but any html in the html description.

just omit the <html> start and end tag.
and also make sure that your exchange server is enabled for both plain and html text.
4/18/2007 9:33 AM | Mladen
Gravatar

# re: WebDAV How, What and Problems...

thanks for the quick reply, Mladen. I tried it

"<body>line1<br>line2</body>" and got a "(400) bad request" err

if I set it as "<body>line1<br/>line2</body>", the text body turns blank again.

is that because Outlook Appointment is in rich-text format? how do i tell it to force a linebreak?

4/18/2007 3:19 PM | emp
Gravatar

# re: WebDAV How, What and Problems...

is your exchange set to handle html body also?
and not just plain text?
4/18/2007 3:24 PM | Mladen
Gravatar

# re: WebDAV How, What and Problems...

I assume yes? I can see/click HTML links in my emails
4/18/2007 7:21 PM | emp
Gravatar

# re: WebDAV How, What and Problems...

Hi

I am creating Appointment in Exchange using webdav but I have some problems.

First. I cant create a recurrent appointment, I can modify an existent one. But the recurrence rule in new ones are ignored. If I create the appointment in outlook with a recurrence, then I can change it every time that I want with webdav.

The xml that creates the appointment is this:

<?xml version="1.0" encoding="utf-8" ?>
<D:propertyupdate xmlns:D="DAV:" xmlns:f="urn:schemas:calendar:" xmlns:m="urn:schemas:httpmail:" xmlns:e="http://schemas.microsoft.com/exchange/" xmlns:dt="urn:uuid:c2f41010-65b3-11d1-a29f-00aa00c14882/">
<D:set>
<D:prop>
<m:importance>2</m:importance>
<D:contentclass>urn:content-classes:appointment</D:contentclass>
<f:busystatus>Busy</f:busystatus>
<e:outlookmessageclass>IPM.Appointment</e:outlookmessageclass>
<m:textdescription></m:textdescription>
<m:subject>meeting</m:subject>
<f:location></f:location>
<f:dtstart dt:dt="dateTime.tz">2007-04-29T22:00:00.0Z</f:dtstart>
<f:dtend dt:dt="dateTime.tz">2007-04-30T22:00:00.0Z</f:dtend>
<f:dtstamp dt:dt="dateTime.tz">2007-04-30T08:36:40.0Z</f:dtstamp>
<f:alldayevent dt:dt="boolean">1</f:alldayevent>
<f:rrule dt:dt="mv.string">
<c:v xmlns:c="xml:">FREQ=DAILY;BYDAY=MO,TU,WE,TH,FR;WKST=SU</c:v>
</f:rrule>
<f:instancetype dt:dt="int">1</f:instancetype>
<f:recurtype>1</f:recurtype>
<f:0x8214 dt:dt="int">1</f:0x8214>
</D:prop>
</D:set>
</D:propertyupdate>

I am forgeting something?


Second. After creating the recurrent appointment, I can create exceptions, I can change the start/end date and subject but I cant change the exception label. Is there some especific property to set?

Third. It's possible to delete the recurrence rule of an appointment?

4/30/2007 10:38 AM | Jordi Fabregat
Gravatar

# re: WebDAV How, What and Problems...

Hi

I can create an outlook contact by using webdav "PROPPATCH" with all details(personal,phones,addresses,emails...).
But my problem is if the contact has Birthday & Anniversary dates, then I have to create the shortcuts or attachments of (birthday & anniversary) alldayevents in his note field using webDAV. If we open these shortcuts, it will open in IE.

By manually allDayEvents are created like this : Insert -> Item -> Calendar(Look in) -> add shortcut or attachment
But I have to add these shortcuts or attachments by using webDAV only. Please help me. I am searching for this since last month.


Thanks in Advance
5/3/2007 1:47 PM | Kumar
Gravatar

# re: WebDAV How, What and Problems...

Jordi:
1. create the exact appointment you want in outlook and then look at it's properties with exchange explorer. it can be found in the exchange SDK.
2. What's an exception label?
3. yes it is. use <d:remove> in the propatch. works the same as <d:set> only you specify the properties to remove,

Kumar:
I'm on vacation until may 9th and i won't be at my work computer where i can check this, so if you can send me a reminder on the 9th and i'll see what i can find.
5/3/2007 4:03 PM | Mladen
Gravatar

# re: WebDAV How, What and Problems...

Hi,

If we give the birthday or anniversary dates, then Outlook autometically creates Recurring Appointment events in Calendar folder and the shortcuts(links) are inserted in the contact's item field.

Now I want to make the same above task by using WebDAV at the time of giving the dates of dirthday & anniversary.
Even I created the exact Recurring Appointment event in Calendar by using WebDAV, I can not see the shortcuts(links) in the contact's item.

I am also setting the Contacts field values in the Appointment Form.


Thanks in Advance


5/5/2007 11:58 AM | kumar
Gravatar

# re: WebDAV How, What and Problems...

Hi,


I have 2 exchange users A,B.

I created an outlook contact manually with all details including Birthday & Anniversary's dates in exchange user A.
Then Outlook autometically creates 2 Recurring Appointments(Yearly) for Birthday & Anniversary's dates in
exchange User A's Calendar folder and the shortcuts(references) are inserted into the contact's item.


Now, I created the same contact's info by using WebDAV in another Exchange User B. I have also filled the Birthday & Anniversary's dates. But the Outlook did not create the 2 Recurring Appointments(Yearly) for Birthday & Anniversary's dates in exchange User B's Calendar folder and the shortcuts(references) are not inserted into the contact's item.

How can we create the Birthday & Anniversary's Recurring Appointments(Yearly) in Calendar folder and insert the shortcuts(references) into the Contact's item using WebDAV?

5/7/2007 1:46 PM | Adi
Gravatar

# re: WebDAV How, What and Problems...

you show how to save an appointment to the calendar.. can you show who you would retrieve calendar info about a person for a day. I'm struggling with this. I have the info coming back that i want, but can't get the all day events to show up. The query i'm sending i've not restricted at all. it brings back the alldayevent column, but it's always 0. when i look in outlook at the calendar, i see the all day event for a certain date, but that doesnt show up in the query. as soon as i change the calendar event to be from a certain time to another, it shows up.

hope this isn't out of the scope..
thanks
shannon
6/5/2007 8:38 PM | jvcoach23
Gravatar

# re: WebDAV How, What and Problems...

jvcoach23:
if i remember correctly (haven't been doing this stuff for a while) you have to set your
alldayevent to 1 and both start and end date to span exactly 24 hours.

Nataraj:
same as to the normal folders. you have to have permissions and you have to specify the correct URI.

Adi:
You can create the recurring appointments by setting the rrule property. I've shown an example in this post.
I have no idea about refernce setting...
6/5/2007 9:04 PM | Mladen
Gravatar

# re: WebDAV How, What and Problems...

I was wondering if you might be able to help with a more specific issue?

Here is the scenario: User's enter data into our tool, specifically Contact info and Task info. My job is to sync this data with exchange. The key piece here is that each Task or Contact has a unique ID, which is assigned by our tool. The old way we were doing this was using MAPI and Outlook. We created a user-defined field and populated it with data from our tool. Now we want to direct this input directly to exchange. So my question is, how can I create Tasks or Contacts at runtime and assign a user-defined field? Keep in mind that this is to run as a service application on the exchange server.

Also, if the Tasks or Contacts are updated in our tool, I need to update that info in exchange? That is really where the unique key comes into play. How can I query exchange for the existence of a Task or contact given the unique id?

Thanks
Rob
6/14/2007 9:16 PM | Rob
Gravatar

# re: WebDAV How, What and Problems...

i usually add custom properties to the DAV: namespace

you can search the exchange like i specified in the post under search
with the exchange dialect of SQL
just add your custom property to the WHERE:

SELECT ...
FROM ...
WHERE "DAV:yourcustomProperty" = 'yourUniqueId'
6/14/2007 9:27 PM | Mladen
Gravatar

# re: WebDAV How, What and Problems...

This seems a very useful blog for WebDAV. I have one query.

I am using WebDav to create and fetch Appiontments from Exchange. I have folowing options.

1. How to fetch Name, Email Id, And Response Status of each Attendee of an Appointment using WebDAV?
2. How to update Attendee's Response Status using WebDAV? We seen the response in Tracking TAB of MS Oulook Appointment screen.

6/20/2007 3:09 PM | Vikrant Agarwal
Gravatar

# re: WebDAV How, What and Problems...

This seems a very useful blog for WebDAV. I have some queries.

I am using WebDav to create and fetch Appiontments from Exchange. Please let me know

1. How to fetch Name, Email Id, And Response Status of each Attendee of an Appointment using WebDAV?
2. How to update Attendee's Response Status using WebDAV? We seen the response in Tracking TAB of MS Oulook Appointment screen.

6/20/2007 3:15 PM | Vikrant Agarwal
Gravatar

# re: WebDAV How, What and Problems...

Hi Can any one tell how to send attachments with the mail using WebDAV in C# ?
7/16/2007 9:10 AM | Sumit Kumar
Gravatar

# re: WebDAV How, What and Problems...

you have to use the PUT command.
if your mail URI is:
http://YourServerName/exchange/YourUserName/YourMail.eml

then your attachment URI should be
http://YourServerName/exchange/YourUserName/YourMail.eml/YourAttactment.txt

7/16/2007 9:41 AM | Mladen
Gravatar

# re: WebDAV How, What and Problems...

Can you send me the syntax explaining how to use PUT for attachments...
7/17/2007 12:27 PM | Sumit Kumar
Gravatar

# re: WebDAV How, What and Problems...

google is your friend:
http://www.thescripts.com/forum/thread473391.html
7/17/2007 12:55 PM | Mladen
Gravatar

# re: WebDAV How, What and Problems...

I am using C# and the other thing is that the URL that you have mentioned is used to send only Mails..There is nothing to add attachments...Pls suugest if you know something on this..Do you know how to use PropPatch and then use PUT ...
7/17/2007 2:44 PM | Sumit Kumar
Gravatar

# re: WebDAV How, What and Problems...

1. proppatch your mail to your drafts folder
2. use put command to the attachment to the mail in drafts
3. move the mail to the dav submission uri.

you just say give me the code. it doesn't work that way. you have to show me what you've tried so far, are there any errors you get etc...

and you're obviously haven't even tried google.
search for "webdav put attachment"
returns this as the first result:
http://www.devnewsgroups.net/group/microsoft.public.exchange.development/topic11435.aspx

7/17/2007 2:58 PM | Mladen
Gravatar

# re: WebDAV How, What and Problems...

Hey..i have already tried this code..But generally i get this exception :Operation Timed out at line

"PUTRequestStream1 = PUTRequest1.GetRequestStream();"...I am able to send the mail but the prob is with attachment..Can you look into this....
7/18/2007 8:59 AM | Sumit Kumar
Gravatar

# re: WebDAV How, What and Problems...

welll then you have a very slow connection to exchange or your exchange is causing problems or you have a firewall in between that lets it through only sometimes...

increase the Timeout property of the HttpWebRequest.

other than that, i have no idea why you're getting your error.
7/18/2007 10:22 AM | Mladen
Gravatar

# re: WebDAV How, What and Problems...

Hi Everybody,



How to create a recurrence reminder(Birthday or Anniversary) and
add the shortcut into text area of the contact's detail either by using MAPI or WebDAV?



Thanks
Adi
7/25/2007 10:34 AM | Adi
Gravatar

# re: WebDAV How, What and Problems...

Hello Mladen,

Great topic and useful comments. I have some code for doing the meeting request and I noticed it's slightly different than yours. For example, in order to create the meeting request, I need to specify the uid of the appointment previously created. I see in one of the comments above that you don't do that. I think using the uid makes sense, if not, how do you relate the meeting request to the appointment?

Regards,
wf
8/4/2007 11:01 PM | wf
Gravatar

# re: WebDAV How, What and Problems...

yes you're right.
when creating the appointment i specify the UID for it.
then when i copy it, the UID is also copied.

I'll probably have to update the article a bit... :)
thanx for pointing it out.
8/4/2007 11:05 PM | Mladen
Gravatar

# re: WebDAV How, What and Problems...

Finally, I got the meeting request working. It seems I was missing the
urn:schemas:calendar:method property "REQUEST". Thanks for sharing
this information by the way.

Surprisingly, this is not mentioned in the "official" sample found it here:
http://msdn2.microsoft.com/en-us/library/aa125929.aspx
unless I need new glasses :D

wf
8/6/2007 12:14 AM | wf
Gravatar

# re: WebDAV How, What and Problems...

These are the specific journal properties of:
Company: http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}/0x8539
Entry Text: http://schemas.microsoft.com/mapi/id/{0006200A-0000-0000-C000-000000000046}/0x8700
StartDate: http://schemas.microsoft.com/mapi/id/{0006200A-0000-0000-C000-000000000046}/0x8706
EndDate: http://schemas.microsoft.com/mapi/id/{0006200A-0000-0000-C000-000000000046}/0x8708
Duration: http://schemas.microsoft.com/mapi/id/{0006200A-0000-0000-C000-000000000046}/0x8707
Type = http://schemas.microsoft.com/mapi/id/{0006200A-0000-0000-C000-000000000046}/0x8712


But what is the property of Dtstamp....
this is urgent......
plz help me....
8/6/2007 12:44 PM | Tarique Waseem
Gravatar

# re: WebDAV How, What and Problems...

i have no idea, sorry.
8/6/2007 1:35 PM | Mladen
Gravatar

# re: WebDAV How, What and Problems...

Hello Mladen, do you know how to get attendee's information from the
appointment? I seem to get it only from the metting request.
However, since the meeting request is moved in order to be sent, I get
"HTTP Error 404 - File or directory not found."

Any ideas how to get it from the appointment? For some reason mailheader
attributes are not returned for the appointment. I must be missing something.
Please, let me know if you have any ideas. Thanks in advance.
8/6/2007 6:54 PM | wf
Gravatar

# re: WebDAV How, What and Problems...

i'd have to know more about your process with meeting requests to answer this.
is this on the organizers or attendee's appointment?

try looking in the TO or FROM property
8/6/2007 7:01 PM | Mladen
Gravatar

# re: WebDAV How, What and Problems...

I am just verifying all attendees are there as expected in the organizer
calendar for now.

There are no TO or FROM properties in the organizer's meeting output.
However, I noticed that I'm not getting them for the meeting request
neither. I must have changed something in my code because I know
I used to get those properties before.

I'll take a look at my recent changes. Thanks anyways Mladen.
8/6/2007 7:35 PM | wf
Gravatar

# re: WebDAV How, What and Problems...

I'm able to get the TO and FROM properties again. However,
for some reason I can get this only from the meeting request.

Since the meeting request is sent to other attendees, it is not
available anymore after a while, this make fail my verification
with an HTTP 404 error.

As a workaround, I'm explicitely inviting the organizer. This way
the organizer will receive and keep a meeting request within his
files. The side effect for this approach is that the organizer will
appear twice in the meeting (as an organizer and as a required
attendee).

Does anyone has a better approach for this issue?
8/6/2007 9:57 PM | wf
Gravatar

# re: WebDAV How, What and Problems...

Hello Mladen,

quick question: do you know by any chance the properties to set the following
when updating a meeting?

"send updates only to added or deleted attendees"
"send updates to all attendees"
"don't send update"
8/7/2007 1:23 AM | wf
Gravatar

# re: WebDAV How, What and Problems...

Hi Mladen

I just want to thank you for the examples and the comments in the blog. You have done a great job, which has helped me a lot.

Keep up the good work.
8/7/2007 11:12 AM | bhj
Gravatar

# re: WebDAV How, What and Problems...

@bhj:
Thanx! glad i could help.

@wf:
well sending an update is the same thing as sending an ordinary meeting request.
get the existing appointment from the organizers calendar.
set it's properties to whatever changed values you need and
send the meeting request with the changed appointment.
that's it.

you still have to handle the TO property logic yourself.
8/7/2007 12:04 PM | Mladen
Gravatar

# re: WebDAV How, What and Problems...

Thanks for your answers Mladen and thanks again for the useful topic.
8/8/2007 1:34 AM | wf
Gravatar

# re: WebDAV How, What and Problems...

Hello Mladen,

I'm working on attachments now. Hopefully you can provide me with some directions. I'm able to send an attachment with a meeting request following the steps you mentioned above. However, I'd like to know if it's possible to associate this with the meeting itself.

In other words, I'd like to create a meeting with attendees and an attachment. The msg sent to the attendees with the attachment will be handled by the meeting request. However, the organizer doesn't have the attachment in his agenda. How can I fix this? Any ideas?

Regards.
8/10/2007 1:46 AM | wf
Gravatar

# re: WebDAV How, What and Problems...

hi!

1. create the original appointment in organizers malibox.
2. copy the appointment
3. attach the file to the copied appointment
4. send the meeting request with the copied appointment

this way the organizer won't have an attachment and the recipients will.
8/10/2007 1:52 AM | Mladen
Gravatar

# re: WebDAV How, What and Problems...

Thanks for you answer Mladen. However, I'm afraid my
explanation wasn't very clear. I apologize.

What I want is to have the attachment also in the organizer's
agenda. Is this possible?
8/10/2007 4:09 PM | wf
Gravatar

# re: WebDAV How, What and Problems...

i'm not sure if the attachments are also copied when you copy the appointment.
i think you need to set the depth header value to infinity.

if that doesn't work just attach the attachment to the original and copied attachment.
8/10/2007 4:45 PM | Mladen
Gravatar

# re: WebDAV How, What and Problems...

The solution I used was to attach the attachment to the appointment
and to the meeting request. This way all agendas (even the organizer)
will have the attchament associated to the appointment. The solution
was as simple as that.

Thanks Mladen, I really appreciate all the help you've provided me :)
8/10/2007 5:31 PM | wf
Gravatar

# re: WebDAV How, What and Problems...

no problem. i'll see you back here when you come to "accepting meeting requests with webdav" not working :)
8/10/2007 6:17 PM | Mladen
Gravatar

# Creating recurring appointment

Hi Mladen,

I have successfully created a single appointment.
Now I am trying to create a recurring appointment, but it still only creates 1 single appointment.
I've even tried copying the rrule property of a real recurring appointment (from Exchange Explorer).
Here is my xml (which only create a single appointment)

<?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:appointment</g:contentclass>
<e:outlookmessageclass>IPM.Appointment</e:outlookmessageclass>
<mail:subject>testWebSvc</mail:subject><mail:htmldescription>body asdfasdf</mail:htmldescription>
<cal:location>somewhere</cal:location>
<cal:dtstart dt:dt="dateTime.tz">2007-08-17T12:10:50.4062500+10:00</cal:dtstart>
<cal:dtend dt:dt="dateTime.tz">2007-08-17T14:40:50.4062500+10:00</cal:dtend>
<cal:instancetype dt:dt="int">0</cal:instancetype>
<cal:busystatus>FREE</cal:busystatus>
<cal:meetingstatus>TENTATIVE</cal:meetingstatus>
<cal:alldayevent dt:dt="boolean">0</cal:alldayevent>
<cal:responserequested dt:dt="boolean">0</cal:responserequested>
<cal:reminderoffset dt:dt="int">0</cal:reminderoffset>
<cal:rrule><r:v xmlns:r="xml:">FREQ=WEEKLY;COUNT=5;INTERVAL=1;BYDAY=FR;WKST=MO</r:v></cal:rrule>
<header:to>test1</header:to>
<mapi:finvited dt:dt="boolean">1</mapi:finvited>
</g:prop></g:set>
</g:propertyupdate>

Could you please help me find what I missed?
Do I need to add any other property? (I only add "rrule", hoping this appointment would be recurring)
Thanks very much.
8/17/2007 4:18 AM | Aximili
Gravatar

# re: WebDAV How, What and Problems...

this should be recurring in the creators calendar.
at first glance i can't see what's wrong with it.

create a new recurring appointment with outlook.
then use either exchange explorer or outlook spy and compare it's properties with
yours.
8/17/2007 10:36 AM | Mladen
Gravatar

# re: WebDAV How, What and Problems...

Hello Mladen,

When you compare the properties using exchange explorer, do you do it in the exchange server
or in the client machine? The reason I'm asking is because Windows XP is not listed as a supported
OS in the download page.

Regards.
8/20/2007 5:50 PM | wf
Gravatar

# re: WebDAV How, What and Problems...

i've downloaded and installed the Exchange SDK which also includes exchange explorer on my XP work machine. i also use it from there.
8/20/2007 5:59 PM | Mladen
Gravatar

# re: WebDAV How, What and Problems...

True, it works fine on WinXP as well. Thanks.
8/20/2007 6:23 PM | wf
Gravatar

# re: WebDAV How, What and Problems...

Hello Mladen,

I'm back with questions regarding accepting meeting request as you predicted it.

1. Is it possible to reply meeting request using webdav? I only found a topic where
you do it mixing webdav and OWA commands. I want to emphasize that what I want
is to create the reply meeting request and not to process it.

2. How do you get the property value mentioned in "dev. problems and bugs - step 3"?
I guess I need to do something like this:

<?xml version=\"1.0\"?>
<a:propertyupdate xmlns:a=\"DAV:\" xmlns:n1=\"http://schemas.microsoft.com/mapi/id/\" ...
<a:set>
<a:prop>
<n1:0x23>Test Text</n1:0x23> <--- not sure about this line
...

Thanks in advance.
8/21/2007 10:39 PM | wf
Gravatar

# re: WebDAV How, What and Problems...

heya!
1.
yes it's possible to reply to meeting requests with WebDAV.
I'm in the porcess of writing a post about this that will go up today or tommorow
It's acctually quite a tricky little bugger.

2.


<?xml version=\"1.0\"?>
<a:propertyupdate xmlns:a=\"DAV:\" xmlns:n1=\"http://schemas.microsoft.com/mapi/id/{6ED8DA90-450B-101B-98DA-00AA003F1305}" >
<a:set>
<a:prop>
<n1:x23>Test Text</n1:x23>
...


you can't have a 0 in front of the x in the property name like i explained in
Development problems and bugs
1. Property naming
8/22/2007 8:13 AM | Mladen
Gravatar

# re: WebDAV How, What and Problems...

Thanks for your fast answer Mladen. I'm looking forward for your new post.

Regards.
8/22/2007 3:27 PM | wf
Gravatar

# re: WebDAV How, What and Problems...

i didn't have much luck. I can get it to create an appointment (non -recurring)
and also, using your help (THANK YOU) I can create a recurring appointment. but it doesn't show up as recurring in outlook.

what i mean is. using webdav I create a recurring appointment (of instance type 1)
and exchange creates the title-2.eml file of instance type 2 automatically
but no recurrring appointments show up!

any tips?
8/28/2007 9:42 PM | jim
Gravatar

# re: WebDAV How, What and Problems...

what are you reffering to as instance type?

in your RRULE you have to set
FREQ=N
or other number, where N means:
"0" = Daily;
"1" = Weekly;
"2" = Monthly;
8/28/2007 9:50 PM | Mladen
Gravatar

# re: WebDAV How, What and Problems...

but it shows up as a string representation then?
examples show this

FREQ=WEEKLY;COUNT=10;INTERVAL=1;BYDAY=WE;WKST=SU

are you saying that I should say freq=1

?
8/29/2007 5:42 PM | jim
Gravatar

# re: WebDAV How, What and Problems...

maybe I should be more clear :)

with to regard to your code :

_RecurrenceType = Enums.RecurrenceType.Daily;

could you post your Enums class?

thanks so much!
8/29/2007 5:55 PM | jim
Gravatar

# re: WebDAV How, What and Problems...

yes you're right.
had a bug in my code. you have to put a string in there and i was putting a number

I haven't done much work with recurrence so i'm not familiar with all it's quirks :)

but it looks like you have to create as many appointments as you need with
the first one (the master) having these 2 properties set:
http://schemas.microsoft.com/exchange/patternstart
http://schemas.microsoft.com/exchange/patternend

try it and let me know.
i'm in muddy waters here too...
8/29/2007 6:03 PM | Mladen
Gravatar

# re: WebDAV How, What and Problems...

so are you saying that we must create EACH appointment individually?

create the master, and then create all of the other ones?


using a seperate request for each???

thanks for your quick replies sir :)
8/29/2007 6:28 PM | jim
Gravatar

# re: WebDAV How, What and Problems...

looks like it...

since webdav is totaly undocumented i can only guess
how the inner workings truly work. :))

if you find a better way do let me know.
8/29/2007 6:29 PM | Mladen
Gravatar

# re: WebDAV How, What and Problems...

could you still post your enums class?
8/29/2007 6:37 PM | jim
Gravatar

# re: WebDAV How, What and Problems...

sure:

public enum RecurrenceType { Daily = 0, Weekly = 1, Monthly = 2, Yearly = 3 }

just remembered:
try setting recurrenceidrange to 1 on the master appt
public enum RecurrenceIDRange { None = 0, ThisAndFuture = 1, ThisAndPrior = 2 }

8/29/2007 6:40 PM | Mladen
Gravatar

# re: WebDAV How, What and Problems...

What does the range do?
I don' t see it in the xml of a recurring appointment (I mean one i created in outlook to check format etc..)
8/29/2007 6:57 PM | jim
Gravatar

# re: WebDAV How, What and Problems...

specifies if the range is set for the future or for the past.
8/29/2007 6:59 PM | Mladen
Gravatar

# re: WebDAV How, What and Problems...

I figued it out.
You don't have to create separate instances for each appointment. Just create the master appt,
BUT you must include the timezone in the create xml (request)

looks like this.


<cal:timezoneid dt:dt="int">11</cal:timezoneid>

where the number (11 in my case) is your time zone.

listing of timezones http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cdosys/html/_cdosys_cdotimezoneid_enum.asp


w000t
thanks for helping we work through it.
8/29/2007 7:58 PM | jim
Gravatar

# re: WebDAV How, What and Problems...

so how'd you figure that out?
8/29/2007 8:00 PM | Mladen
Gravatar

# Links have been moved

The MSDN links have been moved to other places. It would be good if they could be adapted.
9/3/2007 1:37 PM | User77
Gravatar

# re: WebDAV How, What and Problems...

updated. thanx.
9/3/2007 2:07 PM | Mladen
Gravatar

# re: WebDAV How, What and Problems...

I'm having trouble changing a single instance of a recurring meeting after the original recurring meeting is created and the request is sent. I've tried creating new meetings of instancetype=3 but that just shows another single appointment in outlook. I've also tried updating the exdate and rdate in existing master appointment, but that always returns 400, bad request.

Do you know how this can be done?
10/6/2007 11:37 PM | Kratz
Gravatar

# re: WebDAV How, What and Problems...

This is the new link

http://msdn2.microsoft.com/en-us/library/ms526601.aspx
10/11/2007 3:02 PM | Angel
Gravatar

# re: WebDAV How, What and Problems...

Hi,
I want to create an appointment on vbscript. The connexion is ok, but I have a problem with the timezone. Why the solution of jim is not ok? the code doesn't bug.
Do you have an idea?

' XML namespace info of the WebDAV request.
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:" & Appt_UID & "/"" " & _
"xmlns:header=""urn:schemas:mailheader:"" " & _
"xmlns:mail=""urn:schemas:httpmail:"">"

' Set the appointment item properties. The reminder time is set in seconds.
' To create an all-day meeting, set the dtstart/dtend range for 24 hours
' or more and set the alldayevent property to 1. See the documentation
' on the properties in the urn:schemas:calendar: namespace for more information.
strCalInfo = "<cal:location>" & "AAa " & Appt_Location & "</cal:location>" & _
"<cal:dtstart dt:dt=""dateTime.tz"">" & Appt_StartDate &"</cal:dtstart>" & _
"<cal:dtend dt:dt=""dateTime.tz"">" & Appt_EndDate & "</cal:dtend>" & _
"<cal:instancetype dt:dt=""int"">" & Appt_InstanceType & "</cal:instancetype>" & _
"<cal:busystatus>" & Appt_Status & "</cal:busystatus>" & _
"<cal:meetingstatus>" & Appt_MeetingStatus & "</cal:meetingstatus>" & _
"<cal:alldayevent dt:dt=""boolean"">" & Appt_AllDayEvent & "</cal:alldayevent>" & _
"<cal:responserequested dt:dt=""boolean"">" & Appt_ResponseRequested & "</cal:responserequested>" & _
"<cal:reminderoffset dt:dt=""int"">" & Appt_ReminderOffset & "</cal:reminderoffset>" & _
"<cal:timezoneid dt:dt=""int"">4</cal:timezoneid>"
10/12/2007 10:15 AM | Angel
Gravatar

# re: WebDAV How, What and Problems...

Using the timezone, can you create the appointment (without any sort of recurrence)?

try creating a single non-recurring appointment first that includes the timezone.

does taht work?
10/18/2007 7:00 PM | jim
Gravatar

# re: WebDAV How, What and Problems...

now I have a question..


does anyone know if you can add an appointment (as admin) to a regular user's mailbox?

or do you have to traverse the user list and call up passwords for each indv user?
10/18/2007 7:01 PM | jim
Gravatar

# re: WebDAV How, What and Problems...

if you can access a mailbox you can add stuff to it.
all you need is to give proper credentials to the http request
10/18/2007 7:08 PM | Mladen
Gravatar

# re: WebDAV How, What and Problems...

hi,

Jim, i don't make recurrence. I want to send only an appointment. For this, I want to give the current hour and the system make itself the translation to UTC hour. I have read we must use "<cal:timezoneid dt:dt=""int"">4</cal:timezoneid>" for this, but it don't work.
10/23/2007 8:40 AM | angel
Gravatar

# re: WebDAV How, What and Problems...

Hello Angel,

I had trouble with this before. Apparently, you need to take care of adjusting the dates before
creating your appointment. You should be asking yourself now what's the purpose of having
the timezoneid element then, well apparently this is needed to creating recurring meetings as
someone stated before. Besides that, I don't see a utility.
10/30/2007 2:23 PM | wf
Gravatar

# re: WebDAV How, What and Problems...

testing
11/9/2007 11:38 AM | choon
Gravatar

# re: WebDAV How, What and Problems...

testing what?
11/9/2007 11:45 AM | Mladen
Gravatar

# re: WebDAV How, What and Problems...

ok please stop posting stuff twice.
your comment if it's too long and if it contains what seems to be a url gets flagged as spam which i have to then manually check which might take a while.
so don't be impatient :)
i'll delete the doubled up stuff now and leave the original.
11/9/2007 11:51 AM | Mladen
Gravatar

# re: WebDAV How, What and Problems...

Hi Mladen,

Sorry for the inconvenience. But over at my side, my screen just freezes and I do not know if my comments went through.

Thanks so much!

sorry again and hope you can advise me :)

11/9/2007 11:57 AM | choon
Gravatar

# re: WebDAV How, What and Problems...

well your body isn't in xml format.
it has to be.
and what is that resource file??

11/9/2007 12:01 PM | Mladen
Gravatar

# re: WebDAV How, What and Problems...

Hello Mladen,
Hello all,

I chanced on this document the other day. It has very useful information about webdav.
Since you're website is visited regularly, I'm posting the link here to the benefice
of the public. I hope you don't mind.
http://blogs.msdn.com/webdav_101/archive/2006/06/30/652851.aspx

Cheers.
11/12/2007 10:21 PM | wf
Gravatar

# re: WebDAV How, What and Problems...

sure thing. more resources is a good thing :)
thanx wf!
11/12/2007 10:26 PM | Mladen
Gravatar

# re: WebDAV How, What and Problems...

Hi Mladen,

I was wondering why my alldayevent prperty does not work when i put it to 1(true)

is there something wrong? Please advise.Thanks

"<?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:f=\"http://schemas.microsoft.com/mapi/id/{00062002-0000-0000-C000-000000000046}/\" "
+ "xmlns:header=\"urn:schemas:mailheader:\" "
+ "xmlns:mail=\"urn:schemas:httpmail:\"" + ">"
+ "<g:set><g:prop>"
+ "<g:contentclass>urn:content-classes:task</g:contentclass>"
+ "<e:outlookmessageclass>IPM.Appointment</e:outlookmessageclass>"
+ "<cal:location>Company</cal:location>"
+ "<cal:dtstart >"+fromDate+"</cal:dtstart>"
+ "<cal:dtend >"+toDate+"</cal:dtend>"
+ "<cal:instancetype dt:dt=\"int\">21</cal:instancetype>"
+ "<cal:busystatus >OOF</cal:busystatus>"
+ "<f:0x8214 dt:dt=\"int\">4</f:0x8214>"
+ "<cal:meetingstatus>CONFIRMED</cal:meetingstatus>"
+ "<cal:alldayevent dt:dt=\"boolean\">1</cal:alldayevent>"
+ "<mapi:finvited dt:dt=\"boolean\">0</mapi:finvited>"
+ "</g:prop></g:set>"
+ "</g:propertyupdate>";
11/14/2007 8:00 AM | choon
Gravatar

# re: WebDAV How, What and Problems...

For the record....my above problem was the time.
make sure it is 12am to 12 am (or any other time u prefer) then the all day events work
11/20/2007 3:19 AM | choon
Gravatar

# re: WebDAV How, What and Problems...

Hi,
I wrote an application(VB.Net) with XmlHttp object (COM) to do some
operations in the exchange server. This application works fine. Now , I want
to write the same application with HttpRequest(.Net) instead of XmlHttp, but
always When I try to get a response from a query, I get the following error :
The remote sever returned an error:(404) Not Found.
Here some lines of the application:

'***** Save the attachment *******
' sUrlAttach is the url of an attachment in the exchange
Dim myreq As Net.HttpWebRequest = Net.WebRequest.Create(sUrlAttach)
myreq.Method = "GET"
myreq.Credentials = New System.Net.NetworkCredential("****", "*****")
' The error occures after this line :
Dim o_resp As Net.WebResponse = myreq.GetResponse()
Dim instream As Stream = o_resp.GetResponseStream()
Dim sr As StreamReader = New StreamReader(instream)
Dim sResp As String = sr.ReadToEnd()
Dim fs As New FileStream("C:\" & attchFileName, FileMode.Create)
Dim w As New StreamWriter(fs)
w.Write(sResp)
w.Close()
fs.Close()

Like I wrote before, This is just one example ,and I have this problem with
others querys too.

Thanks,

David
12/23/2007 5:44 PM | David
Gravatar

# re: WebDAV How, What and Problems...

Your article is great, but I am having a little bit of trouble. I can create appointments in my calendar. And I can send Meeting Requests, without adding an appointment to ym calendar. I cannot figure out how to copy and appointment and update it and send it as a meeting request. I can attach my code, if you would like, or if you have some sample code I can look at I would really appreciate it. Thanks in advance!
1/5/2008 10:20 PM | Mike
Gravatar

# re: WebDAV How, What and Problems...

hello

i'm creating, updating and deleting appointments with webdav. for meeting requests i'm also sending out notifications to the participants. it's all working fine except that when i get a response from one of the praticipants (accept/deny/tentative) and i delete that response my appointment gets deleted also...

maybe i need to be a little more specific: i create an appointment / meeting request with webdav, then the other user accepts it (manually) in his/her outlook client (thus sending back the response) and i open and delete the response (manually) in my outlook client - at that point my (original) appointment gets deleted, too.

i think the problem must be something around what you called "AppointmentAndMeetingRequestResponseConnector" :-). when i don't set a value for this property the appointments don't get deleted - but the answers don't get reflected in my appointments either (always "no responses have been received"). when i set the property the answers get reflected, but then the appointments gets deleted, too.

here's the xml i use to create a new appointment:

<?xml version="1.0"?>
<dav:propertyupdate xmlns:dav="DAV:">
<dav:set>
<dav:prop>
<cal:busystatus xmlns:cal="urn:schemas:calendar:">Busy</cal:busystatus>
<mapif:0x23 d4p1:dt="bin.base64" xmlns:d4p1="urn:uuid:c2f41010-65b3-11d1-a29f-00aa00c14882/" xmlns:mapif="http://schemas.microsoft.com/mapi/id/{6ED8DA90-450B-101B-98DA-00AA003F1305}/">OAA4ADEAZgBlAGUAZgBmAC0AYgA4ADIAZAAtADQANQA1ADMALQA5AGEANgAxAC0AYgAwAGIAZgBkADIAZgA2AGEAZQA0ADcA</mapif:0x23>
<cal:instancetype d4p1:dt="int" xmlns:d4p1="urn:uuid:c2f41010-65b3-11d1-a29f-00aa00c14882/" xmlns:cal="urn:schemas:calendar:">0</cal:instancetype>
<mapi:finvited d4p1:dt="boolean" xmlns:d4p1="urn:uuid:c2f41010-65b3-11d1-a29f-00aa00c14882/" xmlns:mapi="http://schemas.microsoft.com/mapi/">1</mapi:finvited>
<cal:meetingstatus xmlns:cal="urn:schemas:calendar:">Confirmed</cal:meetingstatus>
<cal:responserequested d4p1:dt="boolean" xmlns:d4p1="urn:uuid:c2f41010-65b3-11d1-a29f-00aa00c14882/" xmlns:cal="urn:schemas:calendar:">1</cal:responserequested>
<cal:dtstart d4p1:dt="dateTime.tz" xmlns:d4p1="urn:uuid:c2f41010-65b3-11d1-a29f-00aa00c14882/" xmlns:cal="urn:schemas:calendar:">2008-01-10T18:17:56.472Z</cal:dtstart>
<cal:dtend d4p1:dt="dateTime.tz" xmlns:d4p1="urn:uuid:c2f41010-65b3-11d1-a29f-00aa00c14882/" xmlns:cal="urn:schemas:calendar:">2008-01-10T19:17:56.472Z</cal:dtend>
<mail:subject xmlns:mail="urn:schemas:httpmail:">test012</mail:subject>
<cal:location xmlns:cal="urn:schemas:calendar:">loc</cal:location>
<mail:htmldescription xmlns:mail="urn:schemas:httpmail:">TEST</mail:htmldescription>
<header:to xmlns:header="urn:schemas:mailheader:">xxx</header:to>
<dav:contentclass>urn:content-classes:appointment</dav:contentclass>
<exch:outlookmessageclass xmlns:exch="http://schemas.microsoft.com/exchange/">IPM.Appointment</exch:outlookmessageclass>
</dav:prop>
</dav:set>
</dav:propertyupdate>

any idea what might be the cause of this behaviour?

thanks in advance, best regards

ps: i know the namespaces are ugly; still investigating why this happens (http://www.tek-tips.com/viewthread.cfm?qid=1440492&page=1). but i don't think that has anything to do with this problem.
1/9/2008 6:25 PM | Sandro Rudin
Gravatar

# re: WebDAV How, What and Problems...

@Sandro:
try setting urn:schemas:calendar:uid on the appointment from which you'll create a meeting request from.
on the namespaces look at How it works? section to see how xml must be formed so the namespaces aren duplicated
1/9/2008 6:40 PM | Mladen
Gravatar

# re: WebDAV How, What and Problems...

@Mike:
Load your original appointment, update the props you need, save it, create a meeting request from it and that should be it.
1/9/2008 6:42 PM | Mladen
Gravatar

# re: WebDAV How, What and Problems...

unfortunately that didn't helped :-(

there is another post up the page by john collins who seems to have been struggling with the same problem - but there's no solution so that doesn't really help either...

i have compared an appointment i created with webdav and one i did with outlook using a PROPFIND with "allprop" and the structure is identical - that way i don't see the mapi properties though...

i'm setting all these properties when creating an appointment:
AllDayEvent
BusyStatus
CalendarId-Mapi0x23
DateTimeStamp
InstanceType
fInvited
MeetingStatus
Priority
ReminderOffset
ResponseRequested
Start
End
Subject
Location
Body
To
Cc
and before sending the meeting request i now also set the CalenderUID (to the value of the CalendarId-Mapi0x23)

anything else that must be set or that shouldn't be touched?

how exactly do i need to set the CalendarId-Mapi0x23 as this is a base64 value (i use Convert.ToBase64(Guid.NewGuid().ToByteArray()))?

to what value do i need to set the CalendarUID; does it has to be the same as the CalendarId-Mapi0x23?

thx for any support, best regards
1/10/2008 7:50 PM | Sandro Rudin
Gravatar

# re: WebDAV How, What and Problems...

Hello,

I'm using WebDAV to do some processing on message items inside
some user's Inbox. I retrieve a chunk of mail message href(s) using
SEARCH method of WebDAV, then set a custom boolean property on each
retrieved message item to label it as processed.

After that, when i do a WebDAV SEARCH request on the Inbox asking for
the message items those who does not have this property set on them,
the returned response has 0 row count..

here is an example of the select statement:

<?xml version="1.0"?>
<D:searchrequest xmlns:D = "DAV:">
<D:sql>
SELECT "DAV:contentclass", "DAV:displayname","urn:schemas-mydomain-
com:processed"
FROM "http://assemwin2003/Exchange/Assem/Inbox/"
WHERE "DAV:ishidden" = false
AND "DAV:isfolder" = false
AND "urn:schemas-mydomain-com:processed" <> CAST("true" AS
"boolean")
</D:sql>
</D:searchrequest>

if i changed the condition to :
...
"urn:schemas-mydomain-com:processed" = CAST("true" AS "boolean")
...
it returns me -successfully- the messages who i set the custom
property on.

So, any body can help on how to construct the search query to return
only the message items who does not have this property at all ?

Thank you in advance.
1/17/2008 11:09 AM | Assem
Gravatar

# re: WebDAV How, What and Problems...

@Sandro Rudin:
i usually set the calendarUID to a guid.
and allprop won't really return all properties. only the default ones for the namespace.
you have to manually add all props to propfind.
but honesly i have no idea on how to help you on this. if you do find the answer do post it here,

@Assem:
"urn:schemas-mydomain-com:processed" = CAST("false" AS "boolean")
1/17/2008 11:36 AM | Mladen
Gravatar

# re: WebDAV How, What and Problems...


"urn:schemas-mydomain-com:processed" = CAST("false" AS "boolean") don't return what I expect :-(

the response :

<?xml version="1.0"?>
<a:multistatus
xmlns:b="urn:uuid:c2f41010-65b3-11d1-a29f-00aa00c14882/"
xmlns:c="xml:" xmlns:d="urn:schemas-mydomain-com:" xmlns:a="DAV:" />

does not return any response element, I think that because the remained Message items doesn't have urn:schemas-mydomain-com:processed property at all :-(

Is there a way to ask the SQL Query processor to return those messages that doesn't have this property ?

thanx.
1/17/2008 4:45 PM | Assem
Gravatar

# re: WebDAV How, What and Problems...

oh by the way when i wanted to set my custom properties i always put them in the DAV namespace and not my own since i foundout that my handling of my own namespace was a bit flaky by the search engine.

you can try where yourProp is null but i don't know if that will work since i'm not familiar with how exchange parses sql queries
1/17/2008 5:05 PM | Mladen
Gravatar

# re: WebDAV How, What and Problems...


just for the records: i did find a solution and like to share it with you as i think that others might stumble over it as well.

to be honest: i didn't find it out myself but got the answer from henning krause. here's the link to his blog addressing the issue i described a bit up the page (and if you check the toc you can find many other interesting posts about webdav and exchange so you might find the solution to other problems there as well):

http://www.infinitec.de/articles/exchange/moreonmeetingandmeetingrequests.aspx

best regards
1/22/2008 1:03 AM | Sandro Rudin
Gravatar

# re: WebDAV How, What and Problems...

Thanx Sandro!
1/23/2008 10:36 AM | Mladen
Gravatar

# re: WebDAV How, What and Problems...

Hy Folks,

i'm looking to get the Attendee Responsestates of an Appointment with WEBDAV

I am able to create an Appointment and send the Meeting Requests via WEBDAV, but howto enum the responseState of each single Attendee??


Could you please help me?!?!

Thanx, ABI
1/25/2008 12:15 PM | Arne
Gravatar

# re: WebDAV How, What and Problems...

Hi there!

Have you ever worked with this section when you're trying to create contacts?

"<e:extensionattribute1>User Data 1</e:extensionattribute1>" +
"<e:extensionattribute2>User Data 2</e:extensionattribute2>" +
"<e:extensionattribute3>User Data 3</e:extensionattribute3>" +
"<e:extensionattribute4>User Data 4</e:extensionattribute4>";

I'm really not sure how it works.

I'm trying to add more user-defined fields of contact information, so that the user can group/sort the contacts by those fields.

I have tried using
"<e:keywords-utf8>"<x:v>" + UserDefinedField1 + "</x:v>" + "<x:v>" + UserDefinedField2 + "</x:v>"+</e:keywords-utf8>)
to create categories. But if i have more than one categories, it gets quite messy.

I hope I'm making sense here. Could you help?

~dave
1/25/2008 11:14 PM | davex
Gravatar

# re: WebDAV How, What and Problems...

Thanks for many great articles on the topic.

I am using webdav to update an exchange calendar which subsequently updates a blackberry. The information I get is from a 3rd party system, so I have no control over that :(

My Question is:

I get the data from the remote system as an appointment, then a list of dates. Is it possible to create a recurring appointment using the rdate field only, or do I need to specify a rrule as well? If I do need an rrule, is there any easy way to obtain a rule from a list of dates?

Thanks in advance,

Chris
2/14/2008 4:38 AM | ChrisRigter
Gravatar

# re: WebDAV How, What and Problems...

Hi

We using webdav SEARCH method to fetch mails (OWA) from exchange server,
our problem is if we fetch few records using HttpWebRequest Addrange method
like : Request.AddRange("rows", 0, 9);
we get all mails instead of first 10 mails.
Is their any suggestion. please reply
2/26/2008 1:29 PM | Arunkumar
Gravatar

# re: WebDAV How, What and Problems...

I want to create a calendar event which is say starting as 11:00 PM on 13th March and ending at 1:00 AM on 14th March. I want this calendar event entry to get added on both the days i.e. 13th March & 14th March.
To achieve this, do I need to send 2 queries to the Exchange server or Exchange server will handle this scenario on its own ?

When I am using the below info for calendar event creation, the entry is getting created only for 13th March and not for 14th. What should be done so that the entry gets created for 14th also ?

" <d:location>" + encodeAmps(location) + "</d:locatio
" <d:dtstart d:dt='dateTime.tz'>" + startZuluTime + "</d:dtstart>" +
" <d:dtend d:dt='dateTime.tz'>" + stopZuluTime + "</d:dtend>" +
" <e:subject>" + encodeAmps(subject) + "</e:subject>" +
" <e:htmldescription>" + encodeAmps(details) + "</e:htmldescription>" +
" <j:to>" +strRequired + "</j:to>" +
" <j:cc>" + strOptional + "</j:cc>" +
" <d:instancetype d:dt='int'>0</d:instancetype>" +
" <d:busystatus>BUSY</d:busystatus>" +
" <d:alldayevent d:dt='boolean'>" + allDayEvent + "</d:alldayevent>" +
" <d:meetingstatus>TENTATIVE</d:meetingstatus>" +
" <d:lastmodified>" + lastModTime + "</d:lastmodified> "
3/13/2008 8:12 AM | Sammy
Gravatar

# re: WebDAV How, What and Problems...

try not setting the allDayEvent at all.
3/13/2008 2:42 PM | Mladen
Gravatar

# re: WebDAV How, What and Problems...

Hi, I am looking for a asp.net (either using vb.net or c-sharp.net) code to send a meeting request using webdav (I do not need any recurrance). It will happen only once. Also, I would like to attach an word document along with the meeting request. I need it soon, Could you please show me or send me the code. Thanks in advance.
3/13/2008 7:29 PM | Rajiv
Gravatar

# re: WebDAV How, What and Problems...

I'm getting the The remote server returned an error: (501) Not Implemented. Exception on Exchange 2007 server.

on the ' MOVEResponse = (System.Net.HttpWebResponse)MOVERequest.GetResponse();'

How do I get this to work on Exchange 2007?
3/27/2008 2:45 PM | D. Dam
Gravatar

# re: WebDAV How, What and Problems...

@D.Dam:
no idea. i don't use exchange 2007 yet. i did remember reading something about having to enable webdav on Ex 2k7...
3/27/2008 2:47 PM | Mladen
Gravatar

# Attendee response information from Meeting Request

Hi Malden,

I am using Exchange 2003 and am trying to query Exchange Store for Attendee Responses having the meeting request item and its attendees information stored in CC and TO properties of the meeting request. I assumed that it is stored somewhere in the Meeting Request itself but I was not able to figure out which property holds the info. Outlook updates the info in the Tracking tab of the appointment so I though they should be somewhere associated with the original meeting request. Could you please help me on this. Thanks. I would also like to thank you for your instructions above that really helped me in my project.
Mansour
5/2/2008 7:30 PM | Mansour
Gravatar

# re: WebDAV How, What and Problems...

Dear Mladen,

First of all Thanks a lot for your above suggestions which helped me to generate meeting requests to different users in my project. But now iam having a problem. From each user, iam taking their network username and password as input and then iam generating meeting requests from their outlook.If they give three times wrong username and password, then our company domain will block their network login for 1 hour.So what my quest is that can i check anywhere user's username and password before sending meeting requests.And one more question is that can i change users from email id.

Please help me in this regard ASAP...
5/5/2008 6:31 AM | Naresh
Gravatar

# re: WebDAV How, What and Problems...

There is no support for using WebDAV for Meetings, Tasks or Recurring Appointments. You may be able to get some basic functionality, however it will not work in all cases and you will end-up at a dead end. For functionality in those ares, consider using Exchange Web Services (EWS) or call CDOEX code in a COM+ service or web service.

I support the WebDAV API against Exchange - please review my blog:

https://blogs.msdn.com/webdav_101/archive/2008/05/01/whats-not-supported-with-webdav.aspx

Thanks,

danba
5/5/2008 4:49 PM | Dan
Gravatar

# re: WebDAV How, What and Problems...

Amazing stuff. Thanks a ton...
5/8/2008 12:21 PM | vijay k
Gravatar

# re: WebDAV How, What and Problems...

Hi Mladen,

Thanks, i successful create an appointment as well as meeting.
Sorry to bother you.
Yes, you are right, google is your friend :)

Best regards,
Lanes
7/3/2008 10:47 AM | Lanes
Gravatar

# re: WebDAV How, What and Problems...

Hi,
I am using WebDav protocol to create/send/delete Appointments/Meeting
requests on Microsoft Exchange server 2003 SP2. I see that every day few
appointment items vanish from the organizer's calendar without anyone
explicitly deleting them. The items get deleted in bulk i.e, 15 - 20 every
day. The software which creates the meeting requests/Appointments is written
in Java and operates under Solaris 10 operating system.
This is also happening with few attendees who say their calendar items are
missing once they accept them. Am I doing something wrong? Please help in finding the issue here?

Advance thanks for the help.
Ramana
7/4/2008 12:26 PM | ramana
Gravatar

# Query webdav for x65e00102 (PR_SOURCE_KEY) in where clause

I am facing issue to fetch x65e00102 (PR_SOURCE_KEY) with webdav.


Copied below the search spec, if some one could give some pointers to
correct the query.

strDAVContactCatSearchSpec = SStext("<?xml
version='1.0'?><d:searchrequest xmlns:d=\"DAV:\"><d:sql>SELECT");
strDAVContactCatSearchSpec += SStext("http://schemas.microsoft.com/exchange/keywords-utf8\)"");
strDAVContactCatSearchSpec += SStext(" FROM scope('SHALLOW
TRAVERSAL OF \"");
strDAVContactCatSearchSpec += rstrURL;
//http://SDCHS20I012:80/exchange/engtest12/contacts/
strDAVContactCatSearchSpec += SStext ("\"')");
strDAVContactCatSearchSpec += SStext(" WHERE \"DAV:contentclass\"
= 'urn:content-classes:person'");
strDAVContactCatSearchSpec += SStext(" AND
\"http://schemas.microsoft.com/mapi/proptag/x65e00102\
(http://schemas.microsoft.com/mapi/proptag/x65e00102\)" = ");
strDAVContactCatSearchSpec += SStext ("CAST('") + rstrEncodedSK
+ SStext ("' AS 'bin.base64')");

strDAVContactCatSearchSpec += SStext("</d:sql></d:searchrequest>");
10/16/2008 8:51 PM | pkj
Gravatar

# re: WebDAV How, What and Problems...

After I debugged the issue. We're going to get a MAPI_E_TOO_COMPLEX (which bubbles up as your 422) if you search for that key. The error is coming from here: 0x65E00102 = PR_SOURCE_KEY

So it is recommended to find a different property to search on. It is suffering from the above limitation when we referenced with WebDAV code.

Recommended workaround:

=======================

The only other workaround here would be to use some other identifier for a message, perhaps dav:id? It doesn't look like EntryID will work without some major change in Exchange. So we need to make use of PermanentURL property.


10/23/2008 8:41 AM | Pkj
Gravatar

# re: WebDAV How, What and Problems...

Hi ramana.
You have to set the property 0x8218 in the appointment propertyset (http://schemas.microsoft.com/mapi/id/{00062002-0000-0000-C000-000000000046}/0x8218) to 1. This is the ResponseType property and a value of 1 means Meeting Organizer. If you don't set this property, Outlook will remove this appointment after you get a meeting response from one of the attendees.

http://www.infini-tec.de/post/2007/07/More-on-meetings-and-meeting-requests.aspx
10/29/2008 2:11 PM | vasarla
Gravatar

# How to get the instances of recurring with WebDav?

Hi,
I am using WebDav protocol to sync Appointments on Microsoft Exchange server 2003 SP1.
I can get the exceptions of recurring with attachment of master item.
And also i can get the deleted ones of recurring with EXDATE.
But how can i get the instances of recurring?
And can i get the index of instance?

Advance thanks for the help.
Ying
12/1/2008 8:15 AM | Ying
Gravatar

# re: WebDAV How, What and Problems...

first fetch the the uid of the master Recurring appointment and using this uid u can fetch all the instances by using the search method .

in where clause keep the condition

Where urn:schemas:calendar:uid = uidString
AND Not urn:schemas:calendar:instancetype = 1


Select "
DAV:href
+ "\"urn:schemas:calendar:location\" AS location, "
+ "\"urn:schemas:httpmail:subject\" AS subject, "

FROM Scope('DEEP TRAVERSAL OF \"\"')"
+ " WHERE urn:schemas:calendar:uid = uidString
AND Not urn:schemas:calendar:instancetype = 1
12/2/2008 8:24 AM | vasa
Gravatar

# re: WebDAV How, What and Problems...

Hi vasa,

Thanks, i can get the instance by the way just as you said.

Another problem.

I'm working for sync data of exchange store to my DB.
I have completed the exchange2007 with webservice.
Now i working on sync recurring item in exchange2003 sp1 with webdav.
I try to use search method to get the recurring master item.
With outlook2003, owa2003 and outlook2007, i do the same thing that i create a recurring master, produce an exception by update its subject. But i get the diffrent results with diffrent client.
With outlook2007, i get the master item with no RRule property. And i can't get the instances with serach method .
With outlook2003, owa2003, i get the master with exactly RRule property. And i can get the instances with serach method too.

I'm confused.

Does anyone know about it?

Advance thanks for the help.
Ying
12/4/2008 10:40 AM | Ying
Gravatar

# re: WebDAV How, What and Problems...

i recommend not to use webdav for exchange 2007.U need to use webservices for 2007 .
12/9/2008 10:16 AM | vasarla
Gravatar

# re: WebDAV How, What and Problems...

Hi Ying
i think the url you are using might be wrong. see the following link. The href u are using may be the culprit.
http://www.infinitec.de/post/2007/03/Constructing-OWA-2007-item-ids-from-WebDAV-items.aspx
12/9/2008 10:51 AM | vasarla
Gravatar

# re: WebDAV How, What and Problems...

I have an error 401. I can access to webmail with the same account. please help
5/7/2009 6:13 AM | Linh Phan
Gravatar

# re: WebDAV How, What and Problems...

When I set a contact birthday in Outlook and then retrieve it through webdav, I actually get the date before the date I set in outlook, with another string attached, for example: 2009-05-15T22:00:00.000Z for a birthday on the 16th.
I can only assume this is some timezone information but how can I deal with this generically?
5/28/2009 3:54 PM | Bas van den Broek
Gravatar

# re: WebDAV How, What and Problems...

Hi,
I am executing he following steps to create a meeting request:

- Create an appointment in your calendar folder (point 2)
- Create the Appointment in Drafts folder with a different URI
- set the http://schemas.microsoft.com/exchange/outlookmessageclass property to "IPM.Schedule.Meeting.Request"
- set the DAV:contentclass property to "urn:content-classes:calendarmessage"
- set the urn:schemas:calendar:method property to "REQUEST"
- PROPPATCH (save) the meeting requests properties
- Attach any Attachment with PUT Request
- MOVE the item to ##DavMailSubmissionURI##

All the steps execute successfully except the last one (MOVE to ##DavMailSubmissionURI##). We are consistently getting "Operation timeout" error when we submit the MOVE request. Even COPY method is giving the same timeout error. Is there any setting on exchange to enable the sending from the ##DavMailSubmissionURI## folder?

Any advice is greatly appreciated?

Thanks,
Furqan
7/10/2009 4:45 PM | Furqan
Gravatar

# re: WebDAV How, What and Problems...

Hi to anyone who makes it this far down the page....

I created my own implementation of the Request class but I was getting a 400 Bad Request error when attempting to use it. The problem was that I had mixed up the order of _HttpWebRequest.ContentType and _HttpWebRequest.Headers. I was assigning the ContentType and then setting the Headers property which was overwriting the previously set ContentType since it is stored in the Headers property as well. As a result, I created a for-loop to to add each header property. I guess you could also just set the Header property first.
11/13/2009 7:42 PM | Vinney
Gravatar

# re: WebDAV How, What and Problems...

hiiiiiiiiii
i m using webdev to set the task in public folder
but i created XML format of task as shown in below but i m able to set only subject and description of task only all other property i m unable to set

i tried all the suggestion given in this site related to task but non of them help me

so can u please tell me what is going wrong with my code
its urgent....

this is my XML format of properties of task.......

"<?xml version='1.0'?> " +
"<d:propertyupdate xmlns:d='DAV:' " +
"xmlns:e='http://schemas.microsoft.com/exchange/' " +
//"xmlns:b='urn:uuid:3EEA72DF-203D-4afb-AC9A-B8B8FE89D261/' " +
"xmlns:b='urn:uuid:" + Guid.NewGuid() + "/' " +
"xmlns:f='urn:schemas:mailheader:' " +
"xmlns:x='xml:\"xmlns:cal=\"urn:schemas:calendar:' " +
"xmlns:g='urn:schemas:httpmail:' " +
"xmlns:h='http://schemas.microsoft.com/mapi/id/{00062003-0000-0000-C000-000000000046}/' " + "xmlns:i='http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}/' > " +
"<d:set> " +
"<d:prop>" +
"<d:contentclass>urn:content-classes:task</d:contentclass>" +
"<e:outlookmessageclass>IPM.Task</e:outlookmessageclass>" +
"<f:subject>mailer utility</f:subject>" +
"<g:textdescription>Mass mailer utility for tester</g:textdescription>" +
"<h:0x00008104 b:dt='dateTime.tz'>2010-01-07T00:00:00Z</h:0x00008104>" +
"<h:0x00008105 b:dt='dateTime.tz'>2010-02-07T00:00:00Z</h:0x00008105>" +
"<h:0x0000811C b:dt='boolean'>1</h:0x0000811C>" +
"<h:0x00008101 b:dt='int'>1</h:0x00008101>" +
"<h:0x00008102 b:dt='float'>0.25</h:0x00008102>" +
"<i:0x00008503 b:dt='boolean'>1</i:0x00008503>" +
"<i:0x00008502 b:dt='dateTime.tz'>2005-09-26T00:00:00Z</i:0x00008502>" +
"<i:0x00008560 b:dt='dateTime.tz'>2005-09-26T00:00:00Z</i:0x00008560> " +

"</d:prop>" +
"</d:set>" +
"</d:propertyupdate>";


thanx in advance......................
1/7/2010 1:43 PM | vimal
Gravatar

# re: WebDAV How, What and Problems...

Hi,
I would need your help.
We are facing one issue.
We have our application which reads all unread email items from a mailbox using Web Dav and does some processing.
It works fine for almost all the emails but only for the emails which a subject line like - Test + Email , i.e having "+" in the subject line do not work.
While forming the mail item , it gives out the error (404) Not Found.
And the URI would look something like - http://XXXXX/exchange/XXX/Inbox/Test%20+%20Email.eml.
Need your help urgently.

THnx Dhipak
5/13/2010 1:41 PM | Dhipak
Gravatar

# re: WebDAV How, What and Problems...

Hi Mladen,
I need your help urgently in solving the above issue.
Pls help...!!!

Thnx
Dhipak
5/14/2010 11:40 AM | Dhipak
Gravatar

# re: WebDAV How, What and Problems...

@Dhipak:
Install the Exchange Explorer from the Exchange SDK and explore your mailbox with it. That should give you the correct url your mail has.

other option could be that you're going through an ISA server that is too strict with characters that it lets through.

Also try looking directly at the HTTP traffic with a network sniffer like WireShark or Fiddler. that could also provide some answers.

Also the URL encode for the + is %2B. so you can try to encode that too by hand.
5/14/2010 11:53 AM | Mladen
Gravatar

# re: WebDAV How, What and Problems...

Hi Mladen,
I have tried giving %2B , but that also throws 404 Error Not Found.
Actually this is our Production server , so it wouldn't be possible to install anything on it.
Is there any other way to resolve this?
Thnx a Ton
5/14/2010 12:06 PM | Dhipak
Gravatar

# re: WebDAV How, What and Problems...

Dear Mladen,
I installed The exchange explorer on my Test server and for the same email , when i click on the eml item , the properties screen was blank , there was nothing present.
But for the other emails , i could see the property details..
5/14/2010 12:46 PM | Dhipak
Gravatar

# re: WebDAV How, What and Problems...

Hi Mladen,

I can not copy it.

Could you send me the total example code.

thanks,

Suhua
7/12/2010 11:01 AM | suhua
Gravatar

# re: WebDAV How, What and Problems...

Hi Mladen,

I am trying to modify the message class property of the email message and then move it to the ##DAVMailSubmissionURI##. It works if the outlookmessageclass property is not customized. However, when I customize the outlookmessageclass property and then move the message I can see the message in the sent email folder but not in the Inbox. Here is my code.. You can see that I am setting the outlookmessageclassproperty to IPC.IMRGlobal.

Thannks.
10/14/2010 1:04 PM | Chaitanya
Gravatar

# re: WebDAV How, What and Problems...

My code

//Do the PROPPATCH
UploadXML = "<?xml version=\"1.0\" encoding=\"utf-8\"?>" + UploadXML;
UploadXML = System.Security.SecurityElement.Escape(UploadXML);
string strxml = "<?xml version=\"1.0\"?>" +
"<d:propertyupdate xmlns:d=\"DAV:\" + xmlns:e=\"http://schemas.microsoft.com/exchange/\">" +
"<d:set>" +
"<d:prop>" +
"<DDHeader xmlns:e=\"\">" + DDHeader + "</DDHeader>" +
"<DDBody xmlns:e=\"\">" + UploadXML + "</DDBody>" +
"<e:outlookmessageclass>" +
"IPC.IMRglobal</e:outlookmessageclass>" +
"</d:prop>" +
"</d:set>" +
"</d:propertyupdate>";

PROPPATCHRequest = (System.Net.HttpWebRequest)System.Net.HttpWebRequest.Create(strTempURI);
PROPPATCHRequest.Credentials = MyCredentialCache;
PROPPATCHRequest.Headers.Set("Translate", "f");
//PROPPATCHRequest.Headers.Set("DDHeader",DDHeader);
PROPPATCHRequest.ContentType = "text/xml";
PROPPATCHRequest.ContentLength = strxml.Length;
PROPPATCHRequest.Method = "PROPPATCH";
byte[] PROPPATCHbytes = Encoding.UTF8.GetBytes(strxml);
PROPPATCHRequest.ContentLength = PROPPATCHbytes.Length;
PROPPATCHRequestStream = PROPPATCHRequest.GetRequestStream();
PROPPATCHRequestStream.Write(PROPPATCHbytes, 0, PROPPATCHbytes.Length);
PROPPATCHRequestStream.Close();
PROPPATCHResponse = (System.Net.HttpWebResponse)PROPPATCHRequest.GetResponse();

//Move File
MOVERequest = (System.Net.HttpWebRequest)System.Net.HttpWebRequest.Create(strTempURI);
MOVERequest.Credentials = MyCredentialCache;
MOVERequest.Method = "MOVE";
MOVERequest.Headers.Add("Destination", strSubURI);
MOVEResponse = (System.Net.HttpWebResponse)MOVERequest.GetResponse();

PUTResponse.Close();
MOVEResponse.Close();
return "";
10/14/2010 1:08 PM | Chaitanya
Comments have been closed on this topic.

Powered by:
Powered By Subtext Powered By ASP.NET