Ser_P
Joined: 17 Oct 2006
Posts: 1
|
Posted:
Tue Oct 17, 2006 2:04 pm Post subject:
WebDav+ Exchange 2003 |
|
|
Hi, all.
In work-time with Exchange Server 2003 with WebDAV we found next strange bug:
sometimes, this code (uses for get a localized name of the Inbox folder) launched from the same with Exchange domain
System.Net.ServicePointManager.CertificatePolicy = new AcceptAllCertificatePolicy();
strBody = "<?xml version='1.0' encoding='utf-8'?>";
strBody += "<a:propfind xmlns:a='DAV:' xmlns:h='urn:schemas:httpmail:'>";
strBody += "<a:prop><h:inbox/></a:prop></a:propfind>";
Request = (System.Net.HttpWebRequest)HttpWebRequest.Create(mailboxRoot);
Request.Credentials = new NetworkCredential(LinkageSystemUserName, LinkageSystemUserPass, ExchangeServerDomain);
Request.Method = "PROPFIND";
Request.PreAuthenticate = true;
Request.ServicePoint.Expect100Continue = false;
Request.ServicePoint.UseNagleAlgorithm = false;
bytes = System.Text.Encoding.UTF8.GetBytes(strBody);
Request.ContentLength = bytes.Length;
RequestStream = Request.GetRequestStream();
RequestStream.Write(bytes, 0, bytes.Length);
RequestStream.Close();
Request.ContentType = "text/xml";
Request.Headers.Add("Depth", "0");
Response = (HttpWebResponse)Request.GetResponse();
Stream ReceiveStream = Response.GetResponseStream();
System.Text.Encoding encode = System.Text.Encoding.GetEncoding("utf-8");
StreamReader sr = new StreamReader(ReceiveStream, encode);
string XmlData = sr.ReadToEnd();
ReceiveStream.Close();
sr.Close();
Response.Close();
works only one time, on all next times server returns (400) Bad request (this continue ~10 minutes, after this it again works one time).
If we launch this code from another domain all working fine.
|
|