How to access public folder items in OWA RRS feed

  • Question

  • Hi,


    I just ask myself how I could implement the access of public folder items in OWA using Exchange Web Services to open public folder messages of a customized message class.

    First, the request parameter "id" contains the OWA item ID. Is there any hint to decide if this request parameter represents a public folder item or a mailbox item? My first guess would be something like if (owaItemId.startsWith('PSI.')) { .. this is likely a public folder item Id ... }.

    If it is a public folder item ID I have to use the class AlternatePublicFolderItemIdType to convert the OWA public folder item ID to a EWS item ID. I also have to now the item ID of the parent folder to specify the "folder" property of the AlternatePublicFolderItemIdType class. But how should I know the parent folder? In which format do I have to specify the folder item ID (I assume it will be the same format as used for the "ItemId" property).


    For public folder items the request parameters passed to the configured ASPX page should be extended to contain

    the parent folder OWA ID and a flag, if the item ID represents a public folder item ID to make the programmer's life easier.


    Currently our application throws the following exception if it tries to access archived (custom message class) public folder messages:


    Url: https://gern:443/owa/forms/Customization/otemail_view.aspx?ae=Item&a=Open&t=IPM.iXOS-ARCHIVE&id=PSI.LgAAAAAaRHOQqmYRzZvIAKoAL8RaAwBCeV0LWah2QaljsBcQrEQbAAAAAG1xAAAB.RgAAAAAaRHOQqmYRzZvIAKoAL8RaCQBCeV0LWah2QaljsBcQrEQbAAAAAG1xAAAdXvu8e6sDQpSPR6FRJFNfAAOdvbG9AAAA&ea=Franz%40R2K9.LOCAL
    User host address:
    User: Franz Beckenbauer
    EX Address: /o=First Organization/ou=Exchange Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=Franz
    SMTP Address: Franz@R2K9.LOCAL
    OWA version:
    Mailbox server: Laim.R2K9.LOCAL

    Exception type: System.Web.HttpUnhandledException
    Exception message: Exception of type 'System.Web.HttpUnhandledException' was thrown.

    Call stack

    System.Web.UI.Page.HandleError(Exception e)
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
    System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
    System.Web.UI.Page.ProcessRequest(HttpContext context)
    ASP.forms_customization_otemail_view_aspx.ProcessRequest(HttpContext context)
    System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

    Inner Exception
    Exception type: OpenText.Exchange.Owa.OwaException
    Exception message: EWS error: This id is of the wrong type for this conversion operation (mailbox id vs. public folder id).

    Call stack

    OpenText.Exchange.Owa.OwaBridge.RetrieveArchivedItemId(String owaItemId)
    ASP.forms_customization_otemail_view_aspx.__Render__control1(HtmlTextWriter __w, Control parameterContainer)
    System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
    System.Web.UI.Page.Render(HtmlTextWriter writer)
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)





    Monday, March 3, 2008 4:42 PM


  • Here's a short update from Microsoft support regarding the conversion of public folder item IDs:


    Currently the only valid way to determine if an item is a public folder item is to test for the "PSI" prefix.  When you have determined that an item is a Public Folder Item, you need to use the AlternatePublicFolderItemIdType to pass into the EWS ConvertId method.  This type has a required field called FolderId, but this field is not actually used for conversion of an OWA Id to an EWS Id (It is only used for conversion from the StoreId format).


    Current guidance is to use the presence of the "PSI" prefix to test if an item is a public folder item.  When using the AlternatePublicFolderItemIdType for any Id type other than StoreId, the FolderId must be set to some value, but the value will be ignored (an empty string will suffice).

    Friday, April 25, 2008 9:01 AM