none
Exchange WebDav Query RRS feed

  • Question

  • Hi,
    I am trying to run a webdav query to search for emails from a particual mailbox which contains the word chain however my Webdav query doesnt seem to work properly. I have posted the query below:

    "<?xml version="1.0"?>
    <g:searchrequest xmlns:g="DAV:">
    <g:sql>
    SELECT "urn:schemas:httpmail:subject", "urn:schemas:httpmail:from", "DAV:displayname", "urn:schemas:httpmail:to" ,"urn:schemas:httpmail:textdescription" ,"urn:schemas:httpmail:date" FROM SCOPE('deep traversal of "https://MYSERVER/exchange/MYMAILBOX/"')  WHERE "urn:schemas:httpmail:textdescription" LIKE "%CHAIN%"
    </g:sql>
    </g:searchrequest>"


    Without the search part `WHERE "urn:schemas:httpmail:textdescription" LIKE "%CHAIN%"` the query executes.

    Any ideas what I am doing wrong?

    Thanks,
    Alex
    Tuesday, November 24, 2009 12:01 PM

Answers

  • Alex,

     

    If you review [MS-XWDSEARCH], you will find the syntax of the like-predicate described in Section 2.2.4.3.4. Upon reviewing your example, it does not conform to the syntax described in the specification. Consider the following section:

     

    2.2.4.3.4.1.2   wildcard-value

     

    The wildcard-value parameter specifies the character pattern to be searched for. It MUST be

    surrounded by single quotes and the last character in the pattern MUST be a percent-sign ('%').

    Note that if the character pattern to be searched for includes a percent-sign, it is encoded as

    '&#24;'.

     

    If you change the like-predicate to the following, it should correct the problem:

     

    LIKE ‘%CHAIN%’

     

    Looking at your second example, it appears that you have enclosed the item on the right of the equality operator in double quotes. This should be enclosed in single quotes, like so:

     

    WHERE "urn:schemas:httpmail:subject" = ’hi’

     

    Does this answer your question?

     

    Dominic Michael Salemno

    Senior Support Escalation Engineer

    US-CSS DSC Protocols Team

    Wednesday, November 25, 2009 8:47 PM

All replies

  • Hi Alex,

    Thanks for you post.  One of the Open Specification Documentation team will be in touch with you soon.


    Best regards, Tom Jebo Senior Support Escalation Engineer Microsoft Open Specification Documentation Support
    Tuesday, November 24, 2009 8:42 PM
  • Hi,
    I also tried the following query which fails:

    "<?xml version="1.0"?><g:searchrequest xmlns:g="DAV:"><g:sql>SELECT "urn:schemas:httpmail:subject" , "urn:schemas:httpmail:from", "DAV:displayname", "urn:schemas:httpmail:to" , "urn:schemas:httpmail:textdescription" , "urn:schemas:httpmail:date" FROM SCOPE('deep traversal of "https://MYSERVER/exchange/MYMAILBOX/"') WHERE "urn:schemas:httpmail:subject"="hi"</g:sql></g:searchrequest>"

    It appears when ever I use the WHERE statment it fails. What am I doing wrong?

    Thanks,
    Alex
    Wednesday, November 25, 2009 11:25 AM
  • Alex,

    I am the engineer who has taken ownership of your issue. I am investigating this and will update you as things progress.

    Dominic Michael Salemno
    Senior Support Escalation Engineer
    US-CSS DSC Protocols Team
    Wednesday, November 25, 2009 7:49 PM
  • Alex,

     

    If you review [MS-XWDSEARCH], you will find the syntax of the like-predicate described in Section 2.2.4.3.4. Upon reviewing your example, it does not conform to the syntax described in the specification. Consider the following section:

     

    2.2.4.3.4.1.2   wildcard-value

     

    The wildcard-value parameter specifies the character pattern to be searched for. It MUST be

    surrounded by single quotes and the last character in the pattern MUST be a percent-sign ('%').

    Note that if the character pattern to be searched for includes a percent-sign, it is encoded as

    '&#24;'.

     

    If you change the like-predicate to the following, it should correct the problem:

     

    LIKE ‘%CHAIN%’

     

    Looking at your second example, it appears that you have enclosed the item on the right of the equality operator in double quotes. This should be enclosed in single quotes, like so:

     

    WHERE "urn:schemas:httpmail:subject" = ’hi’

     

    Does this answer your question?

     

    Dominic Michael Salemno

    Senior Support Escalation Engineer

    US-CSS DSC Protocols Team

    Wednesday, November 25, 2009 8:47 PM
  • Hi,
    Thank you very much for your help. It now works, I wasnt aware that single/doubble quotes made any difference.

    I think it would be good to make that clear on the following pages too:

    http://msdn.microsoft.com/en-us/library/aa123626%28EXCHG.65%29.aspx

    http://msdn.microsoft.com/en-us/library/aa123910%28EXCHG.65%29.aspx

    Thanks again,
    Alex
    Thursday, November 26, 2009 8:52 AM
  • Alex,

    I will be filing a bug against the documentation so that this is more clear in future releases of the documentation.

    Dominic Michael Salemno
    Senior Support Escalation Engineer
    US-CSS DSC Protocols Team

    Monday, November 30, 2009 6:24 PM
  • Alex,

    I am the engineer who has taken ownership of your issue. I am investigating this and will update you as things progress.

    Dominic Michael Salemno
    Senior Support Escalation Engineer
    US-CSS DSC Protocols Team

    It's quite useful, Thanks for your effort!
    Tuesday, February 22, 2011 1:44 AM