views:

736

answers:

2

Hi,

I am trying to read a public calendar (in public folders) in my Exchange server. I am sending the following query to my Exchange server, and the server replies with 400 - Bad Request.

<?xml version=""1.0""?>
<g:searchrequest xmlns:g=""DAV:"">
  <g:sql>
      SELECT
          ""urn:schemas:httpmail:subject"",
          ""urn:schemas:calendar:location"",
          ""urn:schemas:calendar:dtstart"",
          ""urn:schemas:calendar:dtend""
      FROM
          Scope('SHALLOW TRAVERSAL OF ""https://server/public/SomeFolder/SomeCalendar/""')
  </g:sql>
</g:searchrequest>

Now that same query works with this store URL: https://server/exchange/username/calendar/

So I know that's the URL that is wrong in the query. If I paste the problematic URL in my web browser, it will come up with the calendar, so the URL does seem fine though.

Any help appreciated.

Thanks Xavier

A: 

Try

https://server/public/SomeFolder/SomeCalendar/?cmd=contents

SillyMonkey
A: 

Thanks SillyMonkey for your input.

Your URL returned the same error but I have found out the problem was with the endpoint I was connecting to to submit the query.

I was posting the query to this URI:

string uri = string.Format("{0}/exchange/{1}", server, credentials.UserName);

and now changed it to:

string uri = string.Format("{0}/public", server);

I am a bit surprised that I have to use different endpoints depending whether I am querying the user's mailbox or the public folders, but it seems to be the way it is.

Xavier Poinas