I am calling GetRoomLists using Exchange Web Services, we are running Exchange 2010. The below code is being executed through a Console application. The call succeeds, per the XML response of "No Error", but no data is returned. We have several hundred rooms listed when you try to add one through an Outlook Appointment, so not sure why this would happen.
I've tried using both EWS DLL version 1.2 and 2.0, using default credentials or passing in credentials. I noticed after originally posting this that the response header says we are using Exchange 2012 SP2, so I tried updating my code to use that ExchangeVersion enum value, but no change in the result.
I have successfully used EWS on this Exchange server to read mailboxes, but never rooms before.
C#
ExchangeService es = new ExchangeService(ExchangeVersion.Exchange2010);
es.TraceFlags = TraceFlags.EwsResponse | TraceFlags.EwsRequest;
es.TraceEnabled = true;
es.UseDefaultCredentials = true;
es.AutodiscoverUrl("[email protected]");
//this collection is empty after processing
EmailAddressCollection eac = es.GetRoomLists();
XML Trace From Web Service Request/Response
<Trace Tag="EwsRequest" Tid="9" Time="2013-03-13 20:39:41Z" Version="14.03.0032.000">
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
<t:RequestServerVersion Version="Exchange2010" />
</soap:Header>
<soap:Body>
<m:GetRoomLists />
</soap:Body>
</soap:Envelope>
</Trace>
<Trace Tag="EwsResponse" Tid="9" Time="2013-03-13 20:39:41Z" Version="14.03.0032.000">
<?xml version="1.0" encoding="utf-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header>
<h:ServerVersionInfo MajorVersion="14" MinorVersion="2" MajorBuildNumber="328" MinorBuildNumber="9" Version="Exchange2010_SP2" xmlns:h="http://schemas.microsoft.com/exchange/services/2006/types" xmlns="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
</s:Header>
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<GetRoomListsResponse ResponseClass="Success" xmlns="http://schemas.microsoft.com/exchange/services/2006/messages">
<ResponseCode>NoError</ResponseCode>
<m:RoomLists xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" />
</GetRoomListsResponse>
</s:Body>
</s:Envelope>
</Trace>
MSDN Documentation on GetRoomLists: http://msdn.microsoft.com/en-us/library/dd899416(v=exchg.140).aspx