ErrorInvalidRequest error when issuing StreamingSubscriptionRequest using EWS

Morten Fischer-Madsen 1 Reputation point
2020-12-04T12:50:55.967+00:00

We have a Windows Service that follows the guidelines described in the article how-to-maintain-affinity-between-group-of-subscriptions-and-mailbox-server. This service has been working as expected for at least a couple of years. We now get the below error when we try to create the subscription for one of the group mailboxes apart from the primary mailox in the group against EWS on Office 365.

Any ideas on what might be causing this all of a sudden? It appears the behaviour of Office 365 has changed?

Error received:
<Trace Tag="EwsResponse" Tid="4" Time="2020-12-04 12:35:30Z" Version="15.00.0847.030">
<?xml version="1.0" encoding="utf-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header>
<Action s:mustUnderstand="1" xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none">*</Action>
</s:Header>
<s:Body>
<s:Fault>
<faultcode xmlns:a="http://schemas.microsoft.com/exchange/services/2006/types">a:ErrorInvalidRequest</faultcode>
<faultstring xml:lang="en-US">Request failed because EWS could not contact the appropriate CAS server for this request.</faultstring>
<detail>
<e:ResponseCode xmlns:e="http://schemas.microsoft.com/exchange/services/2006/errors">ErrorInvalidRequest</e:ResponseCode>
<e:Message xmlns:e="http://schemas.microsoft.com/exchange/services/2006/errors">Request failed because EWS could not contact the appropriate CAS server for this request.</e:Message>
</detail>
</s:Fault>
</s:Body>
</s:Envelope>
</Trace>

The request issued is:
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
X-AnchorMailbox: desklondon1@conciergebuildings.com
X-PreferServerAffinity: true

<?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="Exchange2013" />
<t:ExchangeImpersonation>
<t:ConnectingSID>
<t:SmtpAddress>desklondon9@conciergebuildings.com</t:SmtpAddress>
</t:ConnectingSID>
</t:ExchangeImpersonation>
</soap:Header>
<soap:Body>
<m:Subscribe>
<m:StreamingSubscriptionRequest>
<t:FolderIds>
<t:DistinguishedFolderId Id="calendar" />
</t:FolderIds>
<t:EventTypes>
<t:EventType>CreatedEvent</t:EventType>
<t:EventType>ModifiedEvent</t:EventType>
</t:EventTypes>
</m:StreamingSubscriptionRequest>
</m:Subscribe>
</soap:Body>
</soap:Envelope>

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
39,201 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.