我試圖使用PullSubscription
與SubscrubeToAllFolders
屬性上Microsoft Office Dev Center如記錄PullSubscription時:InternalServerError製作與SubscribeToAllFolders
<?xml version="1.0" encoding="UTF-8"?>
<s:Envelope xmlns:s="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">
<s:Header>
<t:RequestServerVersion Version="Exchange2013_SP1" />
</s:Header>
<s:Body>
<m:Subscribe>
<m:PullSubscriptionRequest SubscribeToAllFolders="">
<t:FolderIds />
<t:EventTypes>
<t:EventType>CopiedEvent</t:EventType>
<t:EventType>CreatedEvent</t:EventType>
<t:EventType>DeletedEvent</t:EventType>
<t:EventType>ModifiedEvent</t:EventType>
<t:EventType>MovedEvent</t:EventType>
<t:EventType>NewMailEvent</t:EventType>
<t:EventType>FreeBusyChangedEvent</t:EventType>
</t:EventTypes>
<t:Watermark />
<t:Timeout>1</t:Timeout>
</m:PullSubscriptionRequest>
</m:Subscribe>
</s:Body>
</s:Envelope>
然而,這將始終與文字An internal server error occurred. The operation failed.
並沒有faultactor
返回ErrorInternalServerError
。我已經嘗試過這種方式,不用多餘的<t:FolderIds />
和<t:Watermark/>
標籤。用不同的超時時間和不同的內容<t:EventTypes>
。
但是,當我手動刪除SubscribeToAllFolders=""
,並添加文件夾,如:
<?xml version="1.0" encoding="UTF-8"?>
<s:Envelope xmlns:s="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">
<s:Header>
<t:RequestServerVersion Version="Exchange2013_SP1" />
</s:Header>
<s:Body>
<m:Subscribe>
<m:PullSubscriptionRequest>
<t:FolderIds>
<t:DistinguishedFolderId Id="inbox" />
</t:FolderIds>
<t:EventTypes>
<t:EventType>CopiedEvent</t:EventType>
<t:EventType>CreatedEvent</t:EventType>
<t:EventType>DeletedEvent</t:EventType>
<t:EventType>ModifiedEvent</t:EventType>
<t:EventType>MovedEvent</t:EventType>
<t:EventType>NewMailEvent</t:EventType>
<t:EventType>FreeBusyChangedEvent</t:EventType>
</t:EventTypes>
<t:Watermark />
<t:Timeout>10</t:Timeout>
</m:PullSubscriptionRequest>
</m:Subscribe>
</s:Body>
</s:Envelope>
我得到預期的迴應。
之前有人有過SubscribeToAllFolders
的問題嗎?有沒有辦法讓它工作?我對EWS和SOAP相對來說比較新,所以我在做任何明確愚蠢的事情嗎?謝謝你的幫助。
謝謝。問題是我沒有在'SubscribeToAllFolders'中設置''true''。我不認爲文件中特別清楚。一旦我改變了這一切,一切正常,沒有格式化或任何問題。 – SCB