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?

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

x
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.

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
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
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.
0
LeeDerbyshireCommented:
0

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
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
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.