解决EWS'ErrorAccessDenied'错误'请求的Web方法对此调用者或应用程序不可用'

时间:2019-04-19 19:28:41

标签: exchangewebservices

我正在使用office.js和Exchange Web服务创建Microsoft Outlook加载项。外接程序使用Office.context.mailbox.makeEwsRequestAsync()发出一些SOAP请求。在外接程序的开发过程中,我配置的SOAP请求运行良好。现在,越来越多的用户正在使用该加载项,我们看到一些makeEwsRequestAsync调用存在问题。值得注意的是,错误日志一直在显示响应:

<?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:ErrorAccessDenied</faultcode>
      <faultstring xml:lang="en-US">The requested web method is unavailable to this caller or application.</faultstring>
      <detail>
        <e:ResponseCode xmlns:e="http://schemas.microsoft.com/exchange/services/2006/errors">ErrorAccessDenied</e:ResponseCode>
        <e:Message xmlns:e="http://schemas.microsoft.com/exchange/services/2006/errors">The requested web method is unavailable to this caller or application.</e:Message>
      </detail>
    </s:Fault>
  </s:Body>
</s:Envelope>

返回此请求的请求是:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
  xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" 
   xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
        <soap:Header>
                <t:RequestServerVersion Version="Exchange2010" />
        </soap:Header>
        <soap:Body>
                <m:ResolveNames ReturnFullContactData="true" SearchScope="ContactsActiveDirectory">
                        <m:UnresolvedEntry>smtp</m:UnresolvedEntry>
                </m:ResolveNames>
        </soap:Body>
</soap:Envelope>

<?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="Exchange2007_SP1"/>
  </soap:Header>
  <soap:Body>
    <m:GetUserAvailabilityRequest>
      <t:TimeZone xmlns="http://schemas.microsoft.com/exchange/services/2006/types">
        <Bias>480</Bias>
        <StandardTime>
          <Bias>0</Bias>
          <Time>02:00:00</Time>
          <DayOrder>5</DayOrder>
          <Month>10</Month>
          <DayOfWeek>Sunday</DayOfWeek>
        </StandardTime>
        <DaylightTime>
          <Bias>-60</Bias>
          <Time>02:00:00</Time>
          <DayOrder>1</DayOrder>
          <Month>4</Month>
          <DayOfWeek>Sunday</DayOfWeek>
        </DaylightTime>
      </t:TimeZone>
      <m:MailboxDataArray>
        <t:MailboxData>
          <t:Email>
            <t:Address>user1234@example.com</t:Address>
          </t:Email>
          <t:AttendeeType>Required</t:AttendeeType>
          <t:ExcludeConflicts>false</t:ExcludeConflicts>
        </t:MailboxData>
      </m:MailboxDataArray>
      <t:FreeBusyViewOptions>
        <t:TimeWindow>
          <t:StartTime>2019-04-21T17:00:00</t:StartTime>
          <t:EndTime>2019-04-23T16:59:59</t:EndTime>
        </t:TimeWindow>
        <t:MergedFreeBusyIntervalInMinutes>30</t:MergedFreeBusyIntervalInMinutes>
        <t:RequestedView>FreeBusy</t:RequestedView>
      </t:FreeBusyViewOptions>
    </m:GetUserAvailabilityRequest>
  </soap:Body>
</soap:Envelope>

从我的测试帐户运行这些请求时,它们不返回错误响应并且运行正常。我怀疑收到此错误的用户正在使用由IT部门管理的Outlook版本,并且这些错误与安全性有关。我对如何设置Outlook或Exchange服务器以及如何影响makeEwsRequestAsync()请求以寻求解决方案的方式还不熟悉。

0 个答案:

没有答案