none
getroomlists is reuturning empty collection RRS feed

  • Question

  • Hi,

    i am running excahnge webservice to get the roomlists, but its coming out to be empty. can anyone suggest what's the reason.

    we have added the rooms through office 365 after following this link 

    http://community.office365.com/en-us/f/158/t/158327.aspx

    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using Microsoft.Exchange.WebServices.Data;
    
    namespace ConsoleApplication1
    {
        
        class Program
        {
            private static ExchangeService service;
            private static ArrayList RoomList = new ArrayList();
            static void Main(string[] args)
            {
                
                service = new ExchangeService(ExchangeVersion.Exchange2010_SP1);            
                service.Credentials = new WebCredentials(user, password);
                service.TraceEnabled = true;
                service.TraceFlags = TraceFlags.All;                       
                 service.Url = new Uri("https://outlook.office365.com/EWS/Exchange.asmx");
                 EmailAddressCollection myRoomLists = service.GetRoomLists();
                 Console.Write(myRoomLists.Count);
                 foreach (EmailAddress address in myRoomLists)
                 {
                     Console.Write(address.Address);
                     RoomList.Add(address);
                 }
    }
    
    Thanks

    Thursday, June 19, 2014 1:04 PM

Answers

All replies

  • Hi,

    i am running excahnge webservice to get the roomlists, but its coming out to be empty. can anyone suggest what's the reason.

    we have added the rooms through office 365 after following this link 

    http://community.office365.com/en-us/f/158/t/158327.aspx

    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using Microsoft.Exchange.WebServices.Data;
    
    namespace ConsoleApplication1
    {
        
        class Program
        {
            private static ExchangeService service;
            private static ArrayList RoomList = new ArrayList();
            static void Main(string[] args)
            {
                
                service = new ExchangeService(ExchangeVersion.Exchange2010_SP1);            
                service.Credentials = new WebCredentials(user, password);
                service.TraceEnabled = true;
                service.TraceFlags = TraceFlags.All;                       
                 service.Url = new Uri("https://outlook.office365.com/EWS/Exchange.asmx");
                 EmailAddressCollection myRoomLists = service.GetRoomLists();
                 Console.Write(myRoomLists.Count);
                 foreach (EmailAddress address in myRoomLists)
                 {
                     Console.Write(address.Address);
                     RoomList.Add(address);
                 }
    }
    Thanks

    Does anybody have any idea, why this is happening. i can not figure it out
    Thursday, June 26, 2014 8:39 AM
  • Did you add your rooms to a room list? If the rooms you created are not in a room list your code will return 0. Use the Exchange Management Shell to create a room list, as shown here Create and manage room mailboxes, under "Create a room list".
    Thursday, June 26, 2014 4:35 PM
    Moderator
  • Hi Mimi,

    Many thanks for your reply, I will ask our administrator to do that. and will test it again.

    Thanks

    Nitin

    Thursday, June 26, 2014 7:58 PM