Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Query Exchange Server 2003 Question [modified]

Query Exchange Server 2003 Question [modified]

Scheduled Pinned Locked Moved C#
questioncsharpjavadatabasecom
6 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    Programm3r
    wrote on last edited by
    #1

    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

    P 1 Reply Last reply
    0
    • P Programm3r

      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

      P Offline
      P Offline
      Programm3r
      wrote on last edited by
      #2

      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: ^_^

      N 1 Reply Last reply
      0
      • P Programm3r

        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: ^_^

        N Offline
        N Offline
        N a v a n e e t h
        wrote on last edited by
        #3

        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 like

        string 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 be SEARCH. Set the WebHeaderCollection to WebDavRequest.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

        P 2 Replies Last reply
        0
        • N N a v a n e e t h

          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 like

          string 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 be SEARCH. Set the WebHeaderCollection to WebDavRequest.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

          P Offline
          P Offline
          Programm3r
          wrote on last edited by
          #4

          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: ^_^

          1 Reply Last reply
          0
          • N N a v a n e e t h

            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 like

            string 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 be SEARCH. Set the WebHeaderCollection to WebDavRequest.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

            P Offline
            P Offline
            Programm3r
            wrote on last edited by
            #5

            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: ^_^

            N 1 Reply Last reply
            0
            • P Programm3r

              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: ^_^

              N Offline
              N Offline
              N a v a n e e t h
              wrote on last edited by
              #6

              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

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups