1
votes

I tried to subscribe push notification for calendar event using ews soap request. But unfortunately it failed

Error: The request failed schema validation: Could not find schema information for the element 'Subscribe'.

I follow the link : https://msdn.microsoft.com/en-us/library/office/aa566188%28v=exchg.150%29.aspx#sectionSection3

Could you please give any solution for that or any resource.

My EWS soap request :

`

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

`

Response

`<?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>`
1
Welcome to Stack Overflow please provide more information as well as your code so that we can better diagnose the issue.rojobo
Thank you. I edited by adding the soap request and response.Julkar Nain

1 Answers

0
votes

You are missing namespace for Subscribe tag. Soething like:

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