GetRoomLists succeeds but returns no data

I call GetRoomLists using Exchange Web Services, we start Exchange 2010. The code below is executed through a console application. The call completed successfully according to the XML response "No Error", but no data is returned. We have several hundred numbers listed when trying to add one through Outlook Appointment, so I'm not sure why this will happen.

I tried to use both the EWS DLL version 1.2 and 2.0, using the default credentials or passing credentials. I noticed that after the initial publication of this response header, it says that we are using Exchange 2012 SP2, so I tried updating my code to use this ExchangeVersion enumeration value, but no changes as a result.

I have successfully used EWS on this Exchange server to read mailboxes, but never before.

WITH#

ExchangeService es = new ExchangeService(ExchangeVersion.Exchange2010); es.TraceFlags = TraceFlags.EwsResponse | TraceFlags.EwsRequest; es.TraceEnabled = true; es.UseDefaultCredentials = true; es.AutodiscoverUrl(" autodiscover@example.com "); //this collection is empty after processing EmailAddressCollection eac = es.GetRoomLists(); 

Track XML from web service / response request

 <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

+6
source share
1 answer

Well, I found a reason / solution. The confusion was that GetRoomLists did not return a list of rooms, but instead a list of a list of rooms or a collection of "Lists of numbers." This is a special type of mailing list that contains a list of rooms.

As stated here, http://social.msdn.microsoft.com/Forums/en-US/exchangesvrdevelopment/thread/4ff04c60-48c2-4a69-ab75-2383e73bfde2 , you need to either set up lists of numbers, or you need to request AD and check msExchRecipientDisplayType attribute for tracking numbers.

This link shows an example of writing an LDAP query to return rooms: http://social.msdn.microsoft.com/Forums/en-US/exchangesvrdevelopment/thread/e2d10953-a8f9-459c-8a0e-f10c2e568b26

The code I put together to find the rooms:

 private List<string> GetConfRooms(string filter) { List<string> sRooms = new List<string>(); DirectoryEntry deDomain = System.DirectoryServices.ActiveDirectory.Domain.GetComputerDomain().GetDirectoryEntry(); DirectorySearcher dsRooms = new DirectorySearcher(deDomain); dsRooms.Filter = string.Format("(&(&(&(mailNickname={0}*)(objectcategory=person)(objectclass=user)(msExchRecipientDisplayType=7))))", filter); dsRooms.PropertiesToLoad.Add("sn"); dsRooms.PropertiesToLoad.Add("mail"); foreach (SearchResult sr in dsRooms.FindAll()) { sRooms.Add(sr.Properties["mail"][0].ToString()); } return sRooms; } 
+9
source

All Articles