Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsWindows Server 2003Windows 2000Windows NTSmall Business ServerVirtual ServerExchange ServerIISHost Integration ServerISA ServerSMSWSUSMOMWindows Media ServerSecurityCertification
Related Topics
SQL ServerMS WindowsMS OfficePC HardwareMore Topics ...

Windows Server Forum / Exchange Server / Development / April 2007

Tip: Looking for answers? Try searching our database.

WEBDAV: how to get a Multiline body in webdav created appointment?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Tmajarov - 03 Jun 2005 17:39 GMT
I am using webdav to create an appointment and post it to a clanedar.  When I
pass a regular string with carriage returns and linefeeds to the
htmldescription field they do not display.  If I try to pass an html
formatted string in the htmldescription field, for example:
"<mail:htmldescription><!DOCTYPE HTML PUBLIC ""-//W3C//DTD W3
HTML//EN""><HTML><HEAD></HEAD><BODY>Test<BR>Testing</BODY></HTML></mail:htmldescription>"
I get a 400 bad request error.  I have tried setting the
httpmail:content-media-type and mailheader:content-type to "text/html" and
this did not help; I still got the bad request error.    Not sure if i need
to set the mailheader:content-transfer-encoding or what. I have not found any
references that addresses this issue.  Can anyone point me in the right
direction on how to get the appointment body to display with line breaks?
Thanks in advance,
Tom Majarov
Tmajarov - 03 Jun 2005 18:30 GMT
Here are two requests I ran the first one that just uses a string in the
htmldescription field works and posts an appointment, the second uses a html
tagged string in the htmldescription field and fails with 400 bad request
error:

this works:
"<?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>Test Appointment Subject</mail:subject>
<mail:htmldescription>test</mail:htmldescription>
<cal:location>meetappt Location</cal:location>
<cal:dtstart dt:dt="dateTime.tz">2005-06-02T10:00:00.000Z</cal:dtstart>
<cal:dtend dt:dt="dateTime.tz">2005-06-02T10:30:00.000Z</cal:dtend>
<cal:instancetype dt="int">0</cal:instancetype>
<cal:busystatus>BUSY</cal:busystatus>
<cal:meetingstatus>CONFIRMED</cal:meetingstatus>
<cal:alldayevent dt:dt="boolean">0</cal:alldayevent>
<cal:responserequested dt:dt="boolean">1</cal:responserequested>
<header:to>tmajarov</header:to>
<mapi:finvited dt:dt="boolean">1</mapi:finvited>
</g:prop>
</g:set>
</g:propertyupdate>"

This doesn't:

"<?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>Test Appointment Subject</mail:subject>
<mail:htmldescription><!DOCTYPE HTML PUBLIC "-//W3C//DTD
W3HTML//EN"><HTML><HEAD></HEAD><BODY>Test<BR>Testing</BODY></HTML></mail:htmldescription>
<cal:location>meetappt Location</cal:location>
<cal:dtstart dt:dt="dateTime.tz">2005-06-02T10:00:00.000Z</cal:dtstart>
<cal:dtend dt:dt="dateTime.tz">2005-06-02T10:30:00.000Z</cal:dtend>
<cal:instancetype dt:dt="int">0</cal:instancetype>
<cal:busystatus>BUSY</cal:busystatus>
<cal:meetingstatus>CONFIRMED</cal:meetingstatus>
<cal:alldayevent dt:dt="boolean">0</cal:alldayevent>
<cal:responserequested dt:dt="boolean">1</cal:responserequested>
<header:to>tmajarov</header:to>
<mapi:finvited dt:dt="boolean">1</mapi:finvited>
</g:prop>
</g:set>
</g:propertyupdate>"

Thanks again hope this helps elucidate the issue,
Tom Majarov
Henning Krause [MVP] - 03 Jun 2005 20:44 GMT
Hello,

you should either escape the tags within the htmldscription tag, or put the
the entire HTML you want to upload in a CDATA section.

Greetings,
Henning Krause [MVP]
==========================
Visit my website: http://www.infinitec.de
Try my free Exchange Explorer: Mistaya
(http://www.infinitec.de/software/mistaya.aspx)

> Here are two requests I ran the first one that just uses a string in the
> htmldescription field works and posts an appointment, the second uses a
[quoted text clipped - 64 lines]
> Thanks again hope this helps elucidate the issue,
> Tom Majarov
Tmajarov - 03 Jun 2005 21:58 GMT
Thanks for the suggestions...
I tried:
Dim body As String = "<!DOCTYPE HTML PUBLIC ""-//W3C//DTD
W3HTML//EN""><HTML><HEAD></HEAD><BODY>Test<BR>Testing</BODY></HTML>"

       body = XmlConvert.EncodeName(body)

"<mail:htmldescription>" & body & "</mail:htmldescription>"

Setting the httpmail and mailheader content to text/html and it posted but
when viewed in the calendar it was still encoded
_x003C__x0021_DOCTYPE_x0020_HTML_x0020_PUBLIC_x0020__x0022_-_x002F__x002F_W3C_x002F__x002F_DTD_x0020_W3HTML_x002F__x002F_EN_x0022__x003E__x003C_HTML_x003E__x003C_HEAD_x003E__x003C__x002F_HEAD_x003E__x003C_BODY_x003E_Test_x003C_BR_x003E_Testing_x003C__x002F_BODY_x003E__x003C__x002F_HTML_x003E_

I tried:
Dim body As String = "<!DOCTYPE HTML PUBLIC ""-//W3C//DTD
W3HTML//EN""><HTML><HEAD></HEAD><BODY>Test<BR>Testing</BODY></HTML>"

"<mail:htmldescription sql:use-cdata=""1"">" & body &
"</mail:htmldescription>"

after adding sql to the xml name space declarations and got a 400 bad
request error.

I tried:
"<mail:htmldescription><![CDATA[" & body & "]]></mail:htmldescription>"
the appointment posted but there was no text at all because I guess the
CDATA call here caused the XML parser to skip it.

Am I missing something in these implementations?
Thanks again,
Tom M.

> Hello,
>
[quoted text clipped - 76 lines]
> > Thanks again hope this helps elucidate the issue,
> > Tom Majarov
Henning Krause [MVP] - 04 Jun 2005 08:07 GMT
Hello,
it works fine if you just replace the < and > chars with &lt; and &gt;.

And if you have any entities (like &nbsp;) in your html code, you should
encode it as &amp;nbsp;

Greetings,
Henning Krause [MVP]
==========================
Visit my website: http://www.infinitec.de
Try my free Exchange Explorer: Mistaya
(http://www.infinitec.de/software/mistaya.aspx)

> Thanks for the suggestions...
> I tried:
[quoted text clipped - 113 lines]
>> > Thanks again hope this helps elucidate the issue,
>> > Tom Majarov
Tmajarov - 06 Jun 2005 13:39 GMT
Works like a charm thanks for the advice.
Tom Majarov

> Hello,
> it works fine if you just replace the < and > chars with < and >.
[quoted text clipped - 126 lines]
> >> > Thanks again hope this helps elucidate the issue,
> >> > Tom Majarov
Breeze - 18 Apr 2007 21:26 GMT
would sth like this work:

string sBody = "<html><body><p>line1</p><p>line2</p></body></html>";
sBody.Replace("<", "<");
sBody.Replace(">", ">");
sBody.Replace("&", "&amp;");

I fired WEBDAV to add appointments with sBody as body text, then nothing
shows up in my calenar.

> Hello,
> it works fine if you just replace the < and > chars with < and >.
[quoted text clipped - 126 lines]
> >> > Thanks again hope this helps elucidate the issue,
> >> > Tom Majarov
Henning Krause [MVP - Exchange] - 18 Apr 2007 22:14 GMT
Hello,

I suppose you replaced the smaller and greater chars with their entity
equivalent...

> sBody.Replace("<", "<");

It's not visible here... If not.. you must replace < with &lt; and > with
&gt;

Best regards,
Henning

> would sth like this work:
>
[quoted text clipped - 143 lines]
>> >> > Thanks again hope this helps elucidate the issue,
>> >> > Tom Majarov
utiq - 30 Apr 2007 19:52 GMT
You can resolve this probem with:
string sBody = "<html><body><p>line1</p><p>line2</p></body></html>";
sBody = HttpUtility.HtmlEncode(sBody);

and in the structure XML of WEbDav put
"<mail:htmldescription>" & sBody & "</mail:htmldescription>"

And your message sent with HTML format

> Hello,
>
[quoted text clipped - 155 lines]
> >> >> > Thanks again hope this helps elucidate the issue,
> >> >> > Tom Majarov
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.