none
Update meeting reqest body using html RRS feed

  • Question

  • Hi All,

    I am new to exchange development. I was able to update meeting request send to me using WEBDAV technology. Code snippets is shown below.

    string meetingItemUrl = owaCalendarUrl + strFilename;//http://xxx/calendar/xx.eml

    HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(meetingItemUrl);

    // Set the method and content type

    request.Method ="POST";

    request.ContentType ="application/x-www-UTF8-encoded";

    // Set the network credentials

    request.Credentials = CredentialCache.DefaultNetworkCredentials;


    // Set up the headers

    request.Accept ="image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, " +

    "application/msword, */*" ;

    request.Headers.Add("Accept-Language", "hu" );

    request.Headers.Add("Accept-Encoding", "gzip, deflate" );

    request.UserAgent ="Mozilla/4 0 (compatible; MSIE 6 0; Windows NT 5 1; " +
    "SV1; NET CLR 1 0 3705; NET CLR 1 1 4322; NET CLR 2 0 50727)" ;

    // Write to the request stream

    Stream requestStream = request.GetRequestStream();

    StreamWriter requestBodyWriter = new StreamWriter(requestStream);

    requestBodyWriter.Write("Cmd=sendappt\n");

    requestBodyWriter.Write("Required={0}\n" , "xxxx");

    requestBodyWriter.Write("Optional=\n");

    requestBodyWriter.Write("Resource=\n" );

    requestBodyWriter.Write("FormType=appointment\n" );

    requestBodyWriter.Write(string.Format("MsgID=/{0}{1}\n", "Calendar/" , "xx.eml"));

    requestBodyWriter.Write(string.Format("urn:schemas:calendar:location={0}\n", "Test" ));

    string sBody = "text http://www.google.com \n this is google" ;

    requestBodyWriter.Write(string.Format("urn:schemas:httpmail:textdescription={0}\n", sBody));

    requestBodyWriter.Flush();

    requestBodyWriter.Close();

    // Send the request

    HttpWebResponse owaResponse = (HttpWebResponse)request.GetResponse();

    Stream objResponse = owaResponse.GetResponseStream();

    StreamReader objReader = new StreamReader(objResponse);

    owaResponse.Close();

    objResponse.Close();

    objReader.Close();

    Problem Statement:

    I am not able to update the meeting request with html. I want to insert a table to the body of the meeting while i am updating.

    When i tried to  change the requestBodyWriter.Write(string.Format("urn:schemas:httpmail:textdescription={0}\n", sBody)); to requestBodyWriter.Write(string.Format("urn:schemas:httpmail:htmldescription={0}\n", sBody)); content of the body is not updating

    i also tried to change content type which is giving me a conflict error.

    Please help in solving this issue, Thanks in advance

    Mathew

    Tuesday, May 17, 2011 3:56 AM