|
|
Hi
Since I cannot get deep traversal to work (see my post from September 9th)
when using user A's credentials to access user B's contacts (even though A
has the rights to access B's contacts, including every subfolder in the
contact folder), I figured I'd try something else:
Do a hierarchical traversal of a user's main contact folder
(http://exchange-server/exchange/user@domain/Contacts/) to get back a list
of subfolders. Unfortunately that only results in one level of contacts
(e.g. if you have a hierarchy like this:
exchange-server/exchange/user@domain/Contacts/Subfolder1">http://exchange-server/exchange/user@domain/Contacts/Subfolder1
exchange-server/exchange/user@domain/Contacts/Subfolder1/SubSubfolder">http://exchange-server/exchange/user@domain/Contacts/Subfolder1/SubSubfolder
exchange-server/exchange/user@domain/Contacts/Subfolder2">http://exchange-server/exchange/user@domain/Contacts/Subfolder2
exchange-server/exchange/user@domain/Contacts/Subfolder2/SubSubfolder">http://exchange-server/exchange/user@domain/Contacts/Subfolder2/SubSubfolder
)
A hierarchical traversal would only return Subfolder1 and Subfolder2, but
not Subfolder1/SubSubfolder and Subfolder2/Subfolder. That can be alleviated
by doing another traversal on the resulting urls of the hierarchical
traversal of the main contact folder, but obviously it's highly ineffective.
Anyway, I figured for starters I'd settle for the main folder and the first
level of subfolders.
Then I constructed a query like this:
String queryString = "<?xml version=\"1.0\"?><D:searchrequest xmlns:D =
\"DAV:\" >"
+ "<D:sql>SELECT "
+ "\"urn:schemas:contacts:givenName\",
\"urn:schemas:contacts:sn\", \"urn:schemas:contacts:telephoneNumber\",
\"urn:schemas:contacts:mobile\", \"urn:schemas:contacts:homePhone\""
+ " FROM SCOPE(" + scopeString + ) "
+ "WHERE \"DAV:ishidden\" = false AND
\"DAV:isfolder\" = false </D:sql></D:searchrequest>";
with scopeString being
String scopeString = "'shallow traversal of
\" exchange-server/exchange/user@domain/Contacts/\"">http://exchange-server/exchange/user@domain/Contacts/\"',
'shallow-traversal of
\" exchange-server/exchange/user@domain/Contacts/Subfolder1\"">http://exchange-server/exchange/user@domain/Contacts/Subfolder1\"',
'shallow-traversal of
\" exchange-server/exchange/user@domain/Contacts/Subfolder2\"">http://exchange-server/exchange/user@domain/Contacts/Subfolder2\"'";
But when I make that query, I get stuck with a 404 error.
If I limit my scopeString to contain just one of the above three urls
(regardless of which one), it works out just fine.
Any ideas what might be going wrong here?
Regards
Stephan
|
|