Hi,
I am developing client application which connects to Outlook 365 using EWS.
Sometimes I get an error : "The specified object was not found in the store." for the request "GetFolder" for the well known folder 'contacts'. Error is rare. Most time I receive normal response.
Example of Request / Response with the error:
---------------------------------------------------
<Trace Tag="EwsRequestHttpHeaders" Tid="6" Time="2016-02-23 14:58:04Z">
POST /EWS/Exchange.asmx HTTP/1.1
Content-Type: text/xml; charset=utf-8
Accept: text/xml
User-Agent: ExchangeServicesClient/15.00.0847.030
Accept-Encoding: gzip,deflate
</Trace>
<Trace Tag="EwsRequest" Tid="6" Time="2016-02-23 14:58:04Z" Version="15.00.0847.030">
<?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="Exchange2010_SP2" />
</soap:Header>
<soap:Body>
<m:GetFolder>
<m:FolderShape>
<t:BaseShape>IdOnly</t:BaseShape>
<t:AdditionalProperties>
<t:ExtendedFieldURI DistinguishedPropertySetId="PublicStrings" PropertyName="StorageSchema" PropertyType="String" />
</t:AdditionalProperties>
</m:FolderShape>
<m:FolderIds>
<t:DistinguishedFolderId Id="contacts" />
</m:FolderIds>
</m:GetFolder>
</soap:Body>
</soap:Envelope>
</Trace>
<Trace Tag="EwsResponseHttpHeaders" Tid="6" Time="2016-02-23 14:58:05Z">
HTTP/1.1 500 Internal Server Error
request-id: f853d42b-06af-4f56-8983-c0633ad07705
X-CalculatedBETarget: BY1PR0701MB1782.namprd07.prod.outlook.com
X-BackEndHttpStatus: 500
X-DiagInfo: BY1PR0701MB1782
X-BEServer: BY1PR0701MB1782
Content-Length: 629
Cache-Control: private
Content-Type: text/xml; charset=utf-8
Set-Cookie: exchangecookie=eaad85dc12f243c4a6ce8e8b69bb3528; expires=Thu, 23-Feb-2017 14:58:05 GMT; path=/; HttpOnly,X-RouteRefreshCookie=zoHNz87J0s/N0s3Mq87LxcrHxc/Kgb2zqq+tz8i8vs/JzYGqgbOWiZq2m7Kakp2ajbGekprFlYqMi5aR0YyQlJCT2svPlpKemJaRmoyQk4qLlpCRjNGckJLazL3Cu56Lnp2ejJq4ipabxcvPys2dnsnJ0p7LnpvSy8fHzdKemZvI0sbJyZvJncfNx8ybmdrLz5aSnpiWkZqMkJOKi5aQkYzRnJCS2svPkZ6Sj42bzsjRj42Qm9GQiouTkJCU0ZyQktrLz8+/zszOz8/IzszPx8rPzcfHyM3M;
expires=Tue, 23-Feb-2016 15:13:05 GMT; path=/
Server: Microsoft-IIS/8.0
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
X-FEServer: BLUPR07CA062
Date: Tue, 23 Feb 2016 14:58:04 GMT
</Trace>
<Trace Tag="EwsResponse" Tid="6" Time="2016-02-23 14:58:05Z" Version="15.00.0847.030">
<?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:ErrorItemNotFound</faultcode>
<faultstring xml:lang="en-US">The specified object was not found in the store.</faultstring>
<detail>
<e:ResponseCode xmlns:e="http://schemas.microsoft.com/exchange/services/2006/errors">ErrorItemNotFound</e:ResponseCode>
<e:Message xmlns:e="http://schemas.microsoft.com/exchange/services/2006/errors">The specified object was not found in the store.</e:Message>
</detail>
</s:Fault>
</s:Body>
</s:Envelope>
</Trace>
---------------------------------------------------
Example of normal Request / Response:
---------------------------------------------------
<Trace Tag="EwsRequestHttpHeaders" Tid="41" Time="2016-02-23 15:23:15Z">
POST /EWS/Exchange.asmx HTTP/1.1
Content-Type: text/xml; charset=utf-8
Accept: text/xml
User-Agent: ExchangeServicesClient/15.00.0847.030
Accept-Encoding: gzip,deflate
</Trace>
<Trace Tag="EwsRequest" Tid="41" Time="2016-02-23 15:23:15Z" Version="15.00.0847.030">
<?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="Exchange2010_SP2" />
</soap:Header>
<soap:Body>
<m:GetFolder>
<m:FolderShape>
<t:BaseShape>IdOnly</t:BaseShape>
<t:AdditionalProperties>
<t:ExtendedFieldURI DistinguishedPropertySetId="PublicStrings" PropertyName="StorageSchema" PropertyType="String" />
</t:AdditionalProperties>
</m:FolderShape>
<m:FolderIds>
<t:DistinguishedFolderId Id="contacts" />
</m:FolderIds>
</m:GetFolder>
</soap:Body>
</soap:Envelope>
</Trace>
<Trace Tag="EwsResponseHttpHeaders" Tid="41" Time="2016-02-23 15:23:15Z">
HTTP/1.1 200 OK
Transfer-Encoding: chunked
Content-Encoding: gzip
Vary: Accept-Encoding
request-id: bfa0469c-186a-4733-9ff2-22423a8b4c6f
X-CalculatedBETarget: BY2PR17MB0263.namprd17.prod.outlook.com
X-BackEndHttpStatus: 200
x-EwsHandler: GetFolder
X-DiagInfo: BY2PR17MB0263
X-BEServer: BY2PR17MB0263
X-FEServer: BN3PR16CA0080
Cache-Control: private
Content-Type: text/xml; charset=utf-8
Date: Tue, 23 Feb 2016 15:23:15 GMT
Set-Cookie: exchangecookie=e965d11d1daf4747b7877929155262c4; expires=Thu, 23-Feb-2017 15:23:15 GMT; path=/; HttpOnly
Server: Microsoft-IIS/8.0
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
</Trace>
<Trace Tag="EwsResponse" Tid="41" Time="2016-02-23 15:23:15Z" Version="15.00.0847.030">
<?xml version="1.0" encoding="utf-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header>
<h:ServerVersionInfo MajorVersion="15" MinorVersion="1" MajorBuildNumber="409" MinorBuildNumber="24" Version="V2016_01_06" xmlns:h="http://schemas.microsoft.com/exchange/services/2006/types"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" />
</s:Header>
<s:Body>
<m:GetFolderResponse xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
<m:ResponseMessages>
<m:GetFolderResponseMessage ResponseClass="Success">
<m:ResponseCode>NoError</m:ResponseCode>
<m:Folders>
<t:ContactsFolder>
<t:FolderId Id="AAMkADgzOWIyM2Y1LTM5OGQtNDQ5Zi1hMGFjLTExMzVlMzNjYjQyMwAuAAAAAACPuqjbnQeXQLNyrRCrlJvDAQD1NCrh4nokQ6J4oUo+ROhLAAAAAAEOAAA=" ChangeKey="AwAAABYAAAD1NCrh4nokQ6J4oUo+ROhLAABkY1+w"
/>
<t:ExtendedProperty>
<t:ExtendedFieldURI DistinguishedPropertySetId="PublicStrings" PropertyName="StorageSchema" PropertyType="String" />
<t:Value>2</t:Value>
</t:ExtendedProperty>
</t:ContactsFolder>
</m:Folders>
</m:GetFolderResponseMessage>
</m:ResponseMessages>
</m:GetFolderResponse>
</s:Body>
</s:Envelope>
</Trace>
---------------------------------------------------
It is the same Outlook 365 account.
I check all the logs. I have found that all the errors is related to the Mailbox server 'namprd07.prod.outlook.com'.
What can be the reason of such strange behavior? Is there any work-around?