none
C#.Net code to get the meeting rooms and their availability from Outlook 2010 RRS feed

  • Question

  • I have wriiten the code to get all the calender items by using
    ExchangeServiceBinding class giving all its credentials and the Url of the server

    The exchange servername is "http://ausyd-exch3.ap.uis.unisys.com/". I have written the code to get the calender items.

    But getting an "No authORIZATION ERROR"

    Below is the code that I have written

    List<CalendarInfo> calendarEvents = new List<CalendarInfo>();

    ExchangeServiceBinding esb = new ExchangeHelper().GetExchangeBinding(credentials);

    // Form the FindItem request.

    FindItemType findItemRequest = new FindItemType();

    DateTime time = new DateTime(2011,06,22);

    DateTime end = new DateTime(2011,06,23);

    CalendarViewType calendarView = new CalendarViewType();

    calendarView.StartDate = time;

    calendarView.EndDate = end;

    if (criteria.MaxItemsToReturn > 0)

    {

    calendarView.MaxEntriesReturned = criteria.MaxItemsToReturn;

    calendarView.MaxEntriesReturnedSpecified = true;

    }

    findItemRequest.Item = calendarView;

    // Define which item properties are returned in the response.

    ItemResponseShapeType itemProperties = new ItemResponseShapeType();

    // Use the Default shape for the response.

    //itemProperties.BaseShape = DefaultShapeNamesType.IdOnly;

    itemProperties.BaseShape = DefaultShapeNamesType.AllProperties;

    findItemRequest.ItemShape = itemProperties;

    DistinguishedFolderIdType[] folderIDArray = new DistinguishedFolderIdType[1];

    folderIDArray[0] = new DistinguishedFolderIdType();

    folderIDArray[0].Id = DistinguishedFolderIdNameType.calendar;

    criteria.EmailAddress = "vijetha.kannaiah@in.unisys.com";

    if (!string.IsNullOrEmpty(criteria.EmailAddress))

    {

    folderIDArray[0].Mailbox = new EmailAddressType();

    folderIDArray[0].Mailbox.EmailAddress = criteria.EmailAddress.Trim();

    }


    findItemRequest.ParentFolderIds = folderIDArray;

    // Define the traversal type.

    findItemRequest.Traversal = ItemQueryTraversalType.Shallow;

    try

    {

    // Send the FindItem request and get the response.

    FindItemResponseType findItemResponse = esb.FindItem(findItemRequest);

    I am getting "No authorization error in the above line of code".

     


    Regards,

    Vijetha


    Saturday, June 25, 2011 11:19 AM

All replies