问题
I'm posting SOAP calls to Exchange webservices (using Delphi and the IpWorks TipwHTTP component) and some of these return with internal server errors (some CreateItem and UpdateItem SOAP actions), but no more info than that:
<?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>
With the EWS Managed API there is such a thing as tracing, but I'm not using that API.
Here is an example of a user who got more detailed error information using that:
<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>
Is there something I can add to the SOAP request, or maybe the HTTP headers, that gives me that additional error information?
Full example of a failing call:
----Request----
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>
----Response----
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>
(I formatted that last XML part). As you can see there is no more error info than the 'internal error'.
Added based on the discussion in the comments:
- I rewrote a SOAP request in a test app to use a RequestServerVersion of 'Exchange2010', 'Exchange2013' or 'Exchange2016' but this gave no additional info in the XML response.
- There was nothing in the Exchange logs. Setting more detailed logging in Exchange did not change that.
来源:https://stackoverflow.com/questions/60505086/how-to-get-more-detailed-error-info-in-ews-soap-response