Подпишитесь на push-уведомление с помощью ews

Я попытался подписаться на push-уведомление для события календаря, используя запрос мыла ews. Но к сожалению не получилось

Ошибка: запрос не прошел проверку схемы: не удалось найти информацию о схеме для элемента «Подписаться».

Я перехожу по ссылке: https://msdn.microsoft.com/en-us/library/office/aa566188%28v=exchg.150%29.aspx#sectionSection3

Не могли бы вы дать какое-либо решение для этого или любого ресурса.

Мой запрос мыла EWS:

`

</t:RequestServerVersion><t:TimeZoneContext><t:TimeZoneDefinition Name="UTC" Id="UTC"></t:TimeZoneDefinition></t:TimeZoneContext>
<t:ExchangeImpersonation>
<t:ConnectingSID>
    <t:PrimarySmtpAddress>test email address</t:PrimarySmtpAddress>
</t:ConnectingSID>
</t:ExchangeImpersonation>

</soap:Header>

  <soap:Body>
<Subscribe xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
           xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <PushSubscriptionRequest xmlns="http://schemas.microsoft.com/exchange/services/2006/messages">
    <FolderIds xmlns="http://schemas.microsoft.com/exchange/services/2006/types">
      <DistinguishedFolderId Id="calendar" />
    </FolderIds>
    <EventTypes xmlns="http://schemas.microsoft.com/exchange/services/2006/types">
      <EventType>CreatedEvent</EventType>
      <EventType>DeletedEvent</EventType>
      <EventType>ModifiedEvent</EventType>
    </EventTypes>
    <StatusFrequency xmlns="http://schemas.microsoft.com/exchange/services/2006/types">1</StatusFrequency>
    <URL xmlns="http://schemas.microsoft.com/exchange/services/2006/types">My own website url</URL>
  </PushSubscriptionRequest>
</Subscribe>

`

Ответ

`<?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:ErrorSchemaValidation</faultcode>
            <faultstring xml:lang="en-US">The request failed schema validation: Could not find schema information for the element 'Subscribe'.</faultstring>
            <detail>
                <e:ResponseCode xmlns:e="http://schemas.microsoft.com/exchange/services/2006/errors">ErrorSchemaValidation</e:ResponseCode>
                <e:Message xmlns:e="http://schemas.microsoft.com/exchange/services/2006/errors">The request failed schema validation.</e:Message>
                <t:MessageXml xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
                    <t:LineNumber>17</t:LineNumber>
                    <t:LinePosition>6</t:LinePosition>
                    <t:Violation>Could not find schema information for the element 'Subscribe'.</t:Violation>
                </t:MessageXml>
            </detail>
        </s:Fault>
    </s:Body>
</s:Envelope>`

person Julkar Nain    schedule 14.06.2016    source источник
comment
Добро пожаловать в Stack Overflow. Пожалуйста, предоставьте дополнительную информацию, а также ваш код, чтобы мы могли лучше диагностировать проблему.   -  person rojobo    schedule 14.06.2016
comment
Спасибо. Я отредактировал, добавив запрос и ответ на мыло.   -  person Julkar Nain    schedule 15.06.2016


Ответы (1)


У вас отсутствует пространство имен для тега Subscribe. Что-то вроде:

<m:Subscribe xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages">
person trigras    schedule 07.04.2020