Как получить более подробную информацию об ошибке в ответе EWS SOAP? - PullRequest
0 голосов
/ 03 марта 2020

Я отправляю SOAP звонки на веб-сервисы Exchange (используя Delphi и компонент IpWorks TipwHTTP), и некоторые из них возвращаются с внутренними ошибками сервера (некоторые действия CreateItem и UpdateItem SOAP) , но не более информации:

<?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:ErrorInternalServerError</faultcode>
<faultstring xml:lang="en-US">An internal server error occurred. The operation failed.</faultstring>
<detail>
<e:ResponseCode xmlns:e="http://schemas.microsoft.com/exchange/services/2006/errors">ErrorInternalServerError</e:ResponseCode>
<e:Message xmlns:e="http://schemas.microsoft.com/exchange/services/2006/errors">An internal server error occurred. The operation failed.</e:Message>
</detail>
</s:Fault>
</s:Body>
</s:Envelope>

В управляемом API EWS есть такая вещь, как трассировка , но я не использую этот API. Здесь - пример пользователя, который получил более подробную информацию об ошибке, используя это:

<m:ResponseMessages>
  <m:FindItemResponseMessage ResponseClass="Error">
    <m:MessageText>An internal server error occurred. The operation failed.</m:MessageText>
    <m:ResponseCode>ErrorInternalServerError</m:ResponseCode>
    <m:DescriptiveLinkKey>0</m:DescriptiveLinkKey>
    <m:MessageXml>
      <t:Value Name="InnerErrorMessageText">Too many concurrent connections opened.</t:Value>
      <t:Value Name="InnerErrorResponseCode">ErrorTooManyObjectsOpened</t:Value>
      <t:Value Name="InnerErrorDescriptiveLinkKey">0</t:Value>
    </m:MessageXml>
  </m:FindItemResponseMessage>
</m:ResponseMessages>

Есть ли что-то, что я могу добавить к запросу SOAP, или, возможно, заголовки HTTP, что дает мне эту дополнительную информацию об ошибке?

Полный пример сбоя вызова:

---- Запрос ----

POST /ews/exchange.asmx HTTP/1.1
Host: webmail.timetellbv.nl
Authorization: NTLM TlRMTVN[snip]AAAA=
Accept: */*
Accept-Encoding: gzip, deflate
User-Agent: IPWorks HTTP Component - www.nsoftware.com
SOAPAction: "http://schemas.microsoft.com/exchange/services/2006/messages/UpdateItem"
Content-Type: text/xml; charset=utf-8
Content-Length: 6485



<soapenv:Envelope
  xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
  xmlns:typ="http://schemas.microsoft.com/exchange/services/2006/types"
  xmlns:mes="http://schemas.microsoft.com/exchange/services/2006/messages">
<soapenv:Header>
  <typ:RequestServerVersion Version="Exchange2007_SP1"/>
  <typ:MailboxCulture>en-US</typ:MailboxCulture>
  <typ:TimeZoneContext>
     <typ:TimeZoneDefinition Id="W. Europe Standard Time"/>
  </typ:TimeZoneContext>
</soapenv:Header>
<soapenv:Body>
<mes:UpdateItem ConflictResolution="AlwaysOverwrite" SendMeetingInvitationsOrCancellations="SendToNone">
   <mes:ItemChanges>
      <typ:ItemChange>
         <typ:ItemId Id="AAMkADQz[snip]wAAA=" ChangeKey="DwAAA[snip]nxYa" />
         <typ:Updates>
            <typ:SetItemField>
               <typ:FieldURI FieldURI="item:Subject"/>
               <typ:CalendarItem>
                 <typ:Subject>Voorbereiden op Fokkema (10-3)</typ:Subject>
               </typ:CalendarItem>
            </typ:SetItemField>
            <typ:SetItemField>
               <typ:FieldURI FieldURI="item:Sensitivity"/>
               <typ:CalendarItem>
                 <typ:Sensitivity>Normal</typ:Sensitivity>
               </typ:CalendarItem>
            </typ:SetItemField>
            <typ:SetItemField>
               <typ:FieldURI FieldURI="item:Categories"/>
               <typ:CalendarItem>
                  <typ:Categories>
                     <typ:String>TimeTell</typ:String>
                  </typ:Categories>
               </typ:CalendarItem>
            </typ:SetItemField>
            <typ:SetItemField>
               <typ:FieldURI FieldURI="item:Body"/>
               <typ:CalendarItem>
                 <typ:Body BodyType="Text">Export projectgegevens van budget naar planningsmodule.</typ:Body>
               </typ:CalendarItem>
            </typ:SetItemField>
            <typ:SetItemField>
               <typ:FieldURI FieldURI="calendar:Location"/>
               <typ:CalendarItem>
                 <typ:Location></typ:Location>
               </typ:CalendarItem>
            </typ:SetItemField>
            <typ:SetItemField>
               <typ:FieldURI FieldURI="calendar:IsAllDayEvent"/>
               <typ:CalendarItem>
                 <typ:IsAllDayEvent>false</typ:IsAllDayEvent>
               </typ:CalendarItem>
            </typ:SetItemField>
            <typ:SetItemField>
               <typ:FieldURI FieldURI="calendar:Start"/>
               <typ:CalendarItem>
                 <typ:Start>2020-03-04T13:00:00.000+01:00</typ:Start>
               </typ:CalendarItem>
            </typ:SetItemField>
            <typ:SetItemField>
               <typ:FieldURI FieldURI="calendar:End"/>
               <typ:CalendarItem>
                 <typ:End>2020-03-04T15:00:00.000+01:00</typ:End>
               </typ:CalendarItem>
            </typ:SetItemField>
            <typ:SetItemField>
               <typ:FieldURI FieldURI="calendar:LegacyFreeBusyStatus"/>
               <typ:CalendarItem>
                 <typ:LegacyFreeBusyStatus>Busy</typ:LegacyFreeBusyStatus>
               </typ:CalendarItem>
            </typ:SetItemField>
            <typ:SetItemField>
               <typ:FieldURI FieldURI="calendar:MeetingTimeZone"/>
               <typ:CalendarItem>
                  <typ:MeetingTimeZone TimeZoneName="W. Europe Standard Time"/>
               </typ:CalendarItem>
            </typ:SetItemField>
            <typ:SetItemField>
               <typ:ExtendedFieldURI DistinguishedPropertySetId="PublicStrings" PropertyName="TimeTellID" PropertyType="Integer"/>
               <typ:CalendarItem>
                  <typ:ExtendedProperty>
                     <typ:ExtendedFieldURI DistinguishedPropertySetId="PublicStrings" PropertyName="TimeTellID" PropertyType="Integer"/>
                     <typ:Value>1707908</typ:Value>
                  </typ:ExtendedProperty>
               </typ:CalendarItem>
            </typ:SetItemField>
            <typ:SetItemField>
               <typ:ExtendedFieldURI DistinguishedPropertySetId="PublicStrings" PropertyName="TimeTellSyncTime" PropertyType="SystemTime"/>
               <typ:CalendarItem>
                  <typ:ExtendedProperty>
                     <typ:ExtendedFieldURI DistinguishedPropertySetId="PublicStrings" PropertyName="TimeTellSyncTime" PropertyType="SystemTime"/>
                     <typ:Value>2020-03-03T10:09:41.949+01:00</typ:Value>
                  </typ:ExtendedProperty>
               </typ:CalendarItem>
            </typ:SetItemField>
            <typ:SetItemField>
               <typ:ExtendedFieldURI DistinguishedPropertySetId="PublicStrings" PropertyName="TimeTellSyncVer" PropertyType="Integer"/>
               <typ:CalendarItem>
                  <typ:ExtendedProperty>
                     <typ:ExtendedFieldURI DistinguishedPropertySetId="PublicStrings" PropertyName="TimeTellSyncVer" PropertyType="Integer"/>
                     <typ:Value>90100</typ:Value>
                  </typ:ExtendedProperty>
               </typ:CalendarItem>
            </typ:SetItemField>
            <typ:SetItemField>
               <typ:ExtendedFieldURI DistinguishedPropertySetId="PublicStrings" PropertyName="TimeTellSyncID" PropertyType="String"/>
               <typ:CalendarItem>
                  <typ:ExtendedProperty>
                     <typ:ExtendedFieldURI DistinguishedPropertySetId="PublicStrings" PropertyName="TimeTellSyncID" PropertyType="String"/>
                     <typ:Value>00000[snip]000</typ:Value>
                  </typ:ExtendedProperty>
               </typ:CalendarItem>
            </typ:SetItemField>
         </typ:Updates>
      </typ:ItemChange>
   </mes:ItemChanges>
</mes:UpdateItem>
</soapenv:Body>
</soapenv:Envelope>

---- Ответ ----

HTTP/1.1 500 Internal Server Error
Cache-Control: private
Transfer-Encoding: chunked
Content-Type: text/xml; charset=utf-8
Server: Microsoft-IIS/10.0
request-id: 679f24c4-547e-4728-a102-049708a78b3a
X-CalculatedBETarget: ttexchange2016.timetellbv.nl
X-DiagInfo: TTEXCHANGE2016
X-BEServer: TTEXCHANGE2016
X-AspNet-Version: 4.0.30319
Set-Cookie: exchangecookie=4b2979acfda04a04896f69c7e3d6d60d; expires=Wed, 03-Mar-2021 09:07:41 GMT; path=/; HttpOnly
Set-Cookie: X-BackEndCookie=S-1-5-21-856652257-446748123-1738634499-1192=u56Lnp[snip]Bzw==; expires=Thu, 02-Apr-2020 09:07:41 GMT; path=/ews; secure; HttpOnly
Persistent-Auth: true
X-Powered-By: ASP.NET
X-FEServer: TTEXCHANGE2016
Date: Tue, 03 Mar 2020 09:07:41 GMT

<?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:ErrorInternalServerError</faultcode>
<faultstring xml:lang="en-US">An internal server error occurred. The operation failed.</faultstring>
<detail>
<e:ResponseCode xmlns:e="http://schemas.microsoft.com/exchange/services/2006/errors">ErrorInternalServerError</e:ResponseCode>
<e:Message xmlns:e="http://schemas.microsoft.com/exchange/services/2006/errors">An internal server error occurred. The operation failed.</e:Message>
</detail>
</s:Fault>
</s:Body>
</s:Envelope>

(я отформатировал эту последнюю XML часть). Как видите, информации об ошибке больше, чем «внутренней ошибки».

Добавлено на основе обсуждения в комментариях:

  • Я переписал SOAP запрос в тестовом приложении на использование RequestServerVersion 'Exchange2010', «Exchange2013» или «Exchange2016», но это не дало никакой дополнительной информации в ответе XML.
  • В журналах Exchange ничего не было. Установка более подробной регистрации в Exchange не изменила это.
...