Exchange Web Services Invalid Restriction

I am trying to understand why the following restriction is considered to be invalid:


<?xml version=\"1.0\" encoding=\"utf-16\"?>
<FindItemType xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" Traversal=\"Shallow\">
  <ItemShape xmlns=\"http://schemas.microsoft.com/exchange/services/2006/messages\">
    <BaseShape xmlns=\"http://schemas.microsoft.com/exchange/services/2006/types\">IdOnly</BaseShape>
  </ItemShape>\r\n  <CalendarView MaxEntriesReturned=\"5000\" StartDate=\"2009-04-14T09:39:16.4531250-04:00\" EndDate=\"2011-04-14T09:39:16.4531250-04:00\" xmlns=\"http://schemas.microsoft.com/exchange/services/2006/messages\" />
  <Restriction xmlns=\"http://schemas.microsoft.com/exchange/services/2006/messages\">
    <Or xmlns=\"http://schemas.microsoft.com/exchange/services/2006/types\">
      <Not>
        <Exists>
          <ExtendedFieldURI PropertySetId=\"a8350054-6f9e-4aaa-b6b7-4b0f12b2f80a\" PropertyName=\"AnKey1\" PropertyType=\"String\" />
        </Exists>
      </Not>
      <IsEqualTo>
        <ExtendedFieldURI PropertySetId=\"a8350054-6f9e-4aaa-b6b7-4b0f12b2f80a\" PropertyName=\"AnKey1\" PropertyType=\"String\" />
        <FieldURIOrConstant>
          <Constant Value=\"\" />\
       </FieldURIOrConstant>
      </IsEqualTo>
    </Or>
  </Restriction>
  <ParentFolderIds xmlns=\"http://schemas.microsoft.com/exchange/services/2006/messages\">
    <DistinguishedFolderId Id=\"calendar\" xmlns=\"http://schemas.microsoft.com/exchange/services/2006/types\" />
  </ParentFolderIds>
</FindItemType>"

Open in new window

FHoldenAsked:
Who is Participating?
 
LeeDerbyshireConnect With a Mentor Commented:
0
 
LeeDerbyshireCommented:
Is the backslash really on the end of line 16?  Or did it creep in when you posted the question?
0
 
FHoldenAuthor Commented:
It crept in during the post sry
0
Simplify Active Directory Administration

Administration of Active Directory does not have to be hard.  Too often what should be a simple task is made more difficult than it needs to be.The solution?  Hyena from SystemTools Software.  With ease-of-use as well as powerful importing and bulk updating capabilities.

 
LeeDerbyshireCommented:
Does your XML response say which part of the restriction it doesn't like?  If not, try removing each of the clauses in turn (you'll probably have to also remove the surrounding <Or/> when you do this) to find out which one is causing the problem.
0
 
FHoldenAuthor Commented:
Unfortunately it simply states "Invalid Restriction".  I have tried quiet a few variations, as soon as I put a restriction on I get "Invalid Restriction" back.  I was hoping that perhaps fresh eyes would see a namespace/conformance issue that I had missed.
0
 
FHoldenAuthor Commented:
Well that's terrible, my understanding is that you can only retreive expanded occurances using the calendar view (since I am doing calendar sync's they are needed).

I suppose I could use the calendarview across the time span and filter the items locally...but that seems an odd approach.

Thank you for your efforts Lee
0
 
LeeDerbyshireCommented:
Yes, I'd suggest inspecting each of the items in the expansion, looking for your specific properties.  Maybe the Managed API can do it, but I never use it, so I don't know.  There aren't many other developers here, and I think the best place to ask would be the Technet Exchange Development forum on the MS site.  Lots of clever people there.

http://social.technet.microsoft.com/Forums/en/exchangesvrdevelopment/threads
0
 
FHoldenAuthor Commented:
It's not a big deal, I already have the code base to translate a where style query into a parse tree.  From there I generate sql,C#,Restrictions, or postfix ldap as needed....it's just a pain.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.