none
EWS - public folder question RRS feed

  • Question

  • This XML works great in retrieving the Firm-Wide public folder. Problem is I'm trying to get the ID for a folder below that one.

    The Firm-Wide folder is here: \\Public Folders - myemail@mydomain.com\All Public Folders\Firm-Wide

    What I need is the ID for this one:

    \\Public Folders - myemail@mydomain.com\All Public Folders\Firm-Wide\Firm Contact List

    Anyone know how I would go about doing that?

     

    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" 
    xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
      <soap:Header>
    <t:RequestServerVersion Version="Exchange2010"/>
      <t:ExchangeImpersonation>
       <t:ConnectingSID>
        <t:PrimarySmtpAddress>myemail@mydomain.com</t:PrimarySmtpAddress>
       </t:ConnectingSID>
      </t:ExchangeImpersonation>
     </soap:Header>
     <soap:Body>
      <FindFolder Traversal="Shallow" xmlns="http://schemas.microsoft.com/exchange/services/2006/messages">
       <FolderShape>
        <t:BaseShape>Default</t:BaseShape>
       </FolderShape>
    	<Restriction>
    	  <t:Contains ContainmentMode="ExactPhrase" ContainmentComparison="Exact">
    		 <t:FieldURI FieldURI="folder:DisplayName" />
    		 <t:Constant Value="Firm-Wide" />
    	  </t:Contains>
    	</Restriction>   
       <ParentFolderIds>
        <t:DistinguishedFolderId Id="publicfoldersroot"/>
       </ParentFolderIds>
      </FindFolder>
     </soap:Body>
    </soap:Envelope>
    

     

    Friday, August 12, 2011 4:47 PM

All replies

  • Hi,

    you need to perform the FindItems recursively, using the folderId from the last operation as base for the next operation. In Pseudo-code:

    folderId = PublicFolderRootId

    for reach (folderName in folderNames) {
     folderId = FindFolder(folderName)
    }

    The id of the desired folder is then stored in the folderId variable.

    May I ask why you are using raw XML? For .NET and Java, there is a managed API. (See http://www.microsoft.com/download/en/details.aspx?id=13480 for the .NET version and http://archive.msdn.microsoft.com/ewsjavaapi for the Java API).

    Kind regards,
    Henning

    Friday, August 12, 2011 8:05 PM
  • Thanks. I'll see if I can use FindItems using the ID of the parent folder.

    I am using IntApp to submit the xml request rather than .Net or Java.

     

     

    Monday, August 15, 2011 11:36 AM