使用SubscribeToAllFolders进行PullSubscription时的InternalServerError

时间:2016-07-27 02:14:43

标签: soap exchangewebservices

我正在尝试将PullSubscriptionMicrosoft Office Dev Center中记录的SubscrubeToAllFolders属性一起使用:

<?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>

但是,这将始终返回ErrorInternalServerError,其中包含文字An internal server error occurred. The operation failed.而不是faultactor。我已尝试使用和不使用多余的<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比较陌生,所以我做了一些明确愚蠢的事情吗?谢谢你的帮助。

1 个答案:

答案 0 :(得分:1)

您的请求格式不正确,例如它应该是

&#13;
&#13;
$this->getParameter('kernel.root_dir') . '/../web/uploads';
&#13;
&#13;
&#13;

我建议您查看使用EWSEditor https://ewseditor.codeplex.com/进行一些测试,它将让您测试操作并为您提供用于每个请求和响应的SOAP。