I want some Moore

Blog about stuff and things and stuff...
mostly about SQL server and .Net
posts - 155, comments - 1387, trackbacks - 33

My Links

SQLTeam.com Links

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'm also a MCP and MCTS for SQL Server. 
Welcome to my blog.

Search this Blog
 

My Blog Feed via Email


Get your Google PageRank
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

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

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

# 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

# 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

# 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

# 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

# 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

# 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

# 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

# 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

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

Hi Mladen,

Could you respond the above mail?

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

# 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

# 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

# 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

# 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

# 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

# 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

# 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

# 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

# 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

# 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

# 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

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

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

# 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

# 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

# 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

# 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

# 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

# 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

# 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

# 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

# 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

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

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

# 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

# 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

# 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

# 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

# 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

# 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

# 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

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

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

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

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

# 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

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

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

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

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

# 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 |

# 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

# 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 |

# 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

# 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

# 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

# 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

# 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

# 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

# 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

# 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

# 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

# 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

# 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

# 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

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

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

# 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

# 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

# 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

# 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

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

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

# 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

# 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

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

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

# 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

# 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 |

# 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

# 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

# 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

# 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}/0x000085