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 / Applications / March 2006

Tip: Looking for answers? Try searching our database.

WebDAV Folder Item Counts

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Thomas Delany - 14 Mar 2006 20:30 GMT
We are using WebDAV to extract and save Exchange users EML files off.  I
have run into a problem when I try and get a list of emails within a
folder.  We use the following…


strQuery = "<?xml version=\"1.0\"?><D:searchrequest xmlns:D = \"DAV:\" >"
+ "<D:sql>SELECT \"DAV:href\", \"DAV:contentclass\", \"urn:schemas:mailheader:message-id\" "
+ "FROM \"" + strRootURI + "\""
+ "WHERE \"DAV:ishidden\" = false AND \"DAV:isfolder\" = false"
+ "</D:sql></D:searchrequest>";


And from that we get the XMLNodeLists…


hrefNodes = ResponseXmlDoc.GetElementsByTagName("a:href");
ContentClassNodes = ResponseXmlDoc.GetElementsByTagName("a:contentclass");
MailHeaderMessageIDNodes = ResponseXmlDoc.GetElementsByTagName("d:message-id");

if(hrefNodes.Count > 0)
{
// Loop through the display name nodes.
     for(int i=0; i<hrefNodes.Count; i++)
     {
           string strClass = ContentClassNodes.Item(i).InnerText;
           string strURL = hrefNodes.Item(i).InnerText;
           string strMsgID = MailHeaderMessageIDNodes.Item(i).InnerText;

           // If this is a message save the EML off into the table
           if (strClass.CompareTo("urn:content-classes:message") == 0)
           {
                 SaveLetter(strURL, strMsgID, strUserName, strPassword,
                 strDomain, strServer, conn);
           }
     }
}

The problem is that the count for the hrefNodes always seems to be double
the other 2.  For example if I have 25 letters in a folder,
hrefNodes.Count is 50 and the other 2 show as 25.  Is there a reason for
this?

Thank You,

Thomas Delany
(for David Marcil)
Glen Scales [MVP] - 14 Mar 2006 23:04 GMT
Try removing DAV:href from your select query it will be returned regardless
but I found that if you do include it then you end up with duplicates like
your experiencing

Cheers
Glen

> We are using WebDAV to extract and save Exchange users EML files off.  I
> have run into a problem when I try and get a list of emails within a
[quoted text clipped - 41 lines]
> Thomas Delany
> (for David Marcil)
 
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.