我正在做一个项目,在这个项目中,一个外部应用程序试图获得Exchange 2010中用户组的可用性信息(空闲/繁忙)以及详细信息(位置/主题/等)。
我已经读了足够多的资料,我认为最好的方法是通过应用程序运行的服务帐户来模拟有问题的用户,并提取他们的日历信息。
我已经为服务帐户设置了模拟,并运行了我在technet上找到的基本测试:http://msdn.microsoft.com/en-us/library/bb204088(v=exchg.140).aspx
这适用于拉回邮箱文件夹(作为示例),如果尝试拉回日历文件夹。
我还发现了如何通过technet获得可用性:http://msdn.microsoft.com/en-us/library/aa563800 (v = exchg.140) . aspx这也将工作,如果我登录的用户,我试图找到日历信息。
当我尝试将模拟XML与get可用性结合起来时,问题就出现了。下面是两个组合的结果:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
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">
<soap:Header>
<t:ExchangeImpersonation>
<t:ConnectingSID>
<t:PrincipalName>[usersname@myorg.org]</t:PrincipalName>
</t:ConnectingSID>
</t:ExchangeImpersonation>
</soap:Header>
<soap:Body>
<GetUserAvailabilityRequest xmlns="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
<t:TimeZone xmlns="http://schemas.microsoft.com/exchange/services/2006/types">
<Bias>300</Bias>
<StandardTime>
<Bias>0</Bias>
<Time>02:00:00</Time>
<DayOrder>1</DayOrder>
<Month>11</Month>
<DayOfWeek>Sunday</DayOfWeek>
</StandardTime>
<DaylightTime>
<Bias>-60</Bias>
<Time>02:00:00</Time>
<DayOrder>2</DayOrder>
<Month>3</Month>
<DayOfWeek>Sunday</DayOfWeek>
</DaylightTime>
</t:TimeZone>
<MailboxDataArray>
<t:MailboxData>
<t:Email>
<t:Address>[usersname@myorg.org]</t:Address>
</t:Email>
<t:AttendeeType>Required</t:AttendeeType>
<t:ExcludeConflicts>false</t:ExcludeConflicts>
</t:MailboxData>
</MailboxDataArray>
<t:FreeBusyViewOptions>
<t:TimeWindow>
<t:StartTime>2011-07-28T00:00:00</t:StartTime>
<t:EndTime>2011-07-28T23:59:59</t:EndTime>
</t:TimeWindow>
<t:MergedFreeBusyIntervalInMinutes>5</t:MergedFreeBusyIntervalInMinutes>
<t:RequestedView>DetailedMerged</t:RequestedView>
</t:FreeBusyViewOptions>
</GetUserAvailabilityRequest>
</soap:Body>
</soap:Envelope>
我得到的结果是:
<?xml version="1.0" encoding="utf-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<s:Fault>
<faultcode xmlns:a="http://schemas.microsoft.com/exchange/services/2006/types">a:ErrorProxyRequestNotAllowed</faultcode>
<faultstring xml:lang="en-US">Client context header found but no request type found in SOAP header.</faultstring>
<detail>
<m:ErrorCode xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages">5015</m:ErrorCode>
</detail>
</s:Fault>
</s:Body>
</s:Envelope>
在technet中挖掘更多,errorproxyrequestnotalallowed信息:此错误表明Exchange Web Services在尝试完成GetUserAvailability请求时发送到另一个客户端访问服务器的请求无效。此响应代码通常表示发生了配置或权限错误,或者有人尝试模仿可用性代理请求失败。"
我遇到的问题是,在我拉回用户的邮件和日历文件夹的情况下,模拟似乎是如何工作的,但在我想检查它们的可用性的情况下不工作。
现在,我只是通过curl发送直接的XML(封装在一个小python脚本中)。
谁有什么建议?提前感谢!
我终于找到了一些(旧的)参考资料,这是GetUser[blank]请求样式调用和冒充的已知特性/错误。这两件事就是不能一起工作。我希望这能为大家节省一点时间。