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=\"\" xmlns:xsi=\"\" Traversal=\"Shallow\">
  <ItemShape xmlns=\"\">
    <BaseShape xmlns=\"\">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=\"\" />
  <Restriction xmlns=\"\">
    <Or xmlns=\"\">
          <ExtendedFieldURI PropertySetId=\"a8350054-6f9e-4aaa-b6b7-4b0f12b2f80a\" PropertyName=\"AnKey1\" PropertyType=\"String\" />
        <ExtendedFieldURI PropertySetId=\"a8350054-6f9e-4aaa-b6b7-4b0f12b2f80a\" PropertyName=\"AnKey1\" PropertyType=\"String\" />
          <Constant Value=\"\" />\
  <ParentFolderIds xmlns=\"\">
    <DistinguishedFolderId Id=\"calendar\" xmlns=\"\" />

Open in new window

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Is the backslash really on the end of line 16?  Or did it creep in when you posted the question?
FHoldenAuthor Commented:
It crept in during the post sry
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.
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.

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.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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
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.
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's just a pain.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Languages and Standards

From novice to tech pro — start learning today.