我使用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.
答案 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];