Query Exchange Server 2003 Question [modified]
-
Hi all, I am searching the Internet for articles on how to query exchange server 2003, without any result.... Can anyone perhaps provide me with a starting point? Struggling to get out of the block :sigh: More specific ... query the appointment items on a specific mailbox Many thanks in advance. Kind regards,
The only programmers that are better C# programmers, are those who look like this -> :bob:
:java: Programm3r My Blog: ^_^
modified on Wednesday, October 7, 2009 2:37 AM
-
Hi all, I am searching the Internet for articles on how to query exchange server 2003, without any result.... Can anyone perhaps provide me with a starting point? Struggling to get out of the block :sigh: More specific ... query the appointment items on a specific mailbox Many thanks in advance. Kind regards,
The only programmers that are better C# programmers, are those who look like this -> :bob:
:java: Programm3r My Blog: ^_^
modified on Wednesday, October 7, 2009 2:37 AM
Hi all, Well I found an example: here[^], but I keep receiving an exception, more specifically: On this line of code:
WebDavResponse = (System.Net.HttpWebResponse)WebDavRequest.GetResponse();
Exception: WebException Description: The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel. Any ideas how I can fix this? Many thanks again. Kind regards,The only programmers that are better C# programmers, are those who look like this -> :bob:
:java: Programm3r My Blog: ^_^
-
Hi all, Well I found an example: here[^], but I keep receiving an exception, more specifically: On this line of code:
WebDavResponse = (System.Net.HttpWebResponse)WebDavRequest.GetResponse();
Exception: WebException Description: The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel. Any ideas how I can fix this? Many thanks again. Kind regards,The only programmers that are better C# programmers, are those who look like this -> :bob:
:java: Programm3r My Blog: ^_^
When requesting to https, you need to add a certificate with the request. Add that to
ClientCertificates
collection of request object. To query exchange server and get all mails from inbox, you could do something likestring serverUrl = "https://yourdomain.com/exchange/userid/inbox/"
const string xml = "<?xml version='1.0'?>" +
"<g:searchrequest xmlns:g='DAV:'>" +
"<g:sql>{0}</g:sql>" +
"</g:searchrequest>";string query = "SELECT * FROM SCOPE('SHALLOW TRAVERSAL OF \"" + serverUrl + "\"') " + "WHERE \"DAV:isfolder\" = false";
string requestString = string.Format(xml, query);WebHeaderCollection headers = new WebHeaderCollection();
headers.Set("Pragma", "no-cache");
headers.Set("Translate", "f");
headers.Set("Depth", "0");WebDavRequest.Method
should beSEARCH
. Set theWebHeaderCollection
toWebDavRequest.Headers
property. I have written a useful WEBDAV wrapper for one of our application. I can share as an article later :)Navaneeth How to use google | Ask smart questions
-
When requesting to https, you need to add a certificate with the request. Add that to
ClientCertificates
collection of request object. To query exchange server and get all mails from inbox, you could do something likestring serverUrl = "https://yourdomain.com/exchange/userid/inbox/"
const string xml = "<?xml version='1.0'?>" +
"<g:searchrequest xmlns:g='DAV:'>" +
"<g:sql>{0}</g:sql>" +
"</g:searchrequest>";string query = "SELECT * FROM SCOPE('SHALLOW TRAVERSAL OF \"" + serverUrl + "\"') " + "WHERE \"DAV:isfolder\" = false";
string requestString = string.Format(xml, query);WebHeaderCollection headers = new WebHeaderCollection();
headers.Set("Pragma", "no-cache");
headers.Set("Translate", "f");
headers.Set("Depth", "0");WebDavRequest.Method
should beSEARCH
. Set theWebHeaderCollection
toWebDavRequest.Headers
property. I have written a useful WEBDAV wrapper for one of our application. I can share as an article later :)Navaneeth How to use google | Ask smart questions
Hi Navaneeth, Thank you for the information, really appreciate it.
N a v a n e e t h wrote:
Add that to ClientCertificates collection of request object.
Hmmm ... this sounds like the difficult part ...
N a v a n e e t h wrote:
I have written a useful WEBDAV wrapper for one of our application. I can share as an article later
That would be awesome!!
The only programmers that are better C# programmers, are those who look like this -> :bob:
:java: Programm3r My Blog: ^_^
-
When requesting to https, you need to add a certificate with the request. Add that to
ClientCertificates
collection of request object. To query exchange server and get all mails from inbox, you could do something likestring serverUrl = "https://yourdomain.com/exchange/userid/inbox/"
const string xml = "<?xml version='1.0'?>" +
"<g:searchrequest xmlns:g='DAV:'>" +
"<g:sql>{0}</g:sql>" +
"</g:searchrequest>";string query = "SELECT * FROM SCOPE('SHALLOW TRAVERSAL OF \"" + serverUrl + "\"') " + "WHERE \"DAV:isfolder\" = false";
string requestString = string.Format(xml, query);WebHeaderCollection headers = new WebHeaderCollection();
headers.Set("Pragma", "no-cache");
headers.Set("Translate", "f");
headers.Set("Depth", "0");WebDavRequest.Method
should beSEARCH
. Set theWebHeaderCollection
toWebDavRequest.Headers
property. I have written a useful WEBDAV wrapper for one of our application. I can share as an article later :)Navaneeth How to use google | Ask smart questions
Hi Navaneeth, Now I keep receiving the following error message, could it be that the WebDav is disabled on the exchange server? The remote server returned an error: (440) Login Timeout. Thanks again. Kind regards,
The only programmers that are better C# programmers, are those who look like this -> :bob:
:java: Programm3r My Blog: ^_^
-
Hi Navaneeth, Now I keep receiving the following error message, could it be that the WebDav is disabled on the exchange server? The remote server returned an error: (440) Login Timeout. Thanks again. Kind regards,
The only programmers that are better C# programmers, are those who look like this -> :bob:
:java: Programm3r My Blog: ^_^
Not sure. I haven't experienced this so far. All I can suggest is to try adding more timeout value.
Navaneeth How to use google | Ask smart questions