SyncFolderHierarchy不适用于Exchange Server 2007

时间:2013-03-06 16:59:23

标签: iphone objective-c exchange-server exchangewebservices

我使用objective-c将以下soap请求发送到Exchange Server 2007。

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
  xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
  <soap:Body>
    <SyncFolderHierarchy  xmlns="http://schemas.microsoft.com/exchange/services/2006/messages">
      <FolderShape>
        <t:BaseShape>AllProperties</t:BaseShape>
      </FolderShape>
    </SyncFolderHierarchy>
  </soap:Body>
</soap:Envelope>

回复后我收到“请求无效”。来自服务器的响应
此请求适用于Exchange Server 2010和2013。 但不使用Exchange Server 2007.

<小时/>   - Exchange Server 2007支持SyncFolderHierarchy 参考: - http://msdn.microsoft.com/en-us/library/exchange/aa564829%28v=exchg.80%29.aspx
我的问题是 [1]我是否需要在Exchange服务器上为SyncFolderHierarchy操作进行任何设置?

1 个答案:

答案 0 :(得分:0)

我查询Exchange 2010,但我必须添加标题:

    NSString *soapMessage = [NSString stringWithFormat:@""
                             @"<?xml version=\"1.0\" encoding=\"utf-8\"?>"
                             @"<soap:Envelope xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:t=\"http://schemas.microsoft.com/exchange/services/2006/types\" xmlns:m=\"http://schemas.microsoft.com/exchange/services/2006/messages\">"
                             @"<soap:Header>"
                             @"<t:RequestServerVersion Version =\"Exchange2010_SP2\"/>"
                             @"</soap:Header>"
                             @"<soap:Body>"
                             @"<m:GetRooms>"
                             @"<m:RoomList>"
                             @"<t:EmailAddress>%@</t:EmailAddress>"
                             @"</m:RoomList>"
                             @"</m:GetRooms>"
                             @"</soap:Body>"
                             @"</soap:Envelope>"
                             @"", roomlist];