none
Exchange Web Services Deserialization Error RRS feed

  • Question

  • I've set up a Push Notification client to receive messages from Exchange Server.  When I receive a message I deserialize it into a SendNotificationResponseType object.  However, when I try to do this I get the exception: There is an error in XML document (1, 2). --->  System.InvalidOperationException: <SendNotificationResponseType xmlns='http://schemas.microsoft.com/exchange/services/2006/messages'> was not expected..

    I've attached the document below.  I've tried unit testing this by saving the xml to a file and loading it directly and I get the same error.  I removed the xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" and just get a different error.  I've also tried renaming the outside tags from SendNotification to SendNotificationResponseType in case it was an issue of the tags not matching the class name and it still failed.

    Any ideas?

    <m:SendNotification xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages">
     <m:ResponseMessages>
      <m:SendNotificationResponseMessage ResponseClass="Success">
       <m:ResponseCode>NoError</m:ResponseCode>
       <m:Notification>
        <t:SubscriptionId>EQB4Y2NhczAyLnRkYmZnLmNvbRAAAAA/f8SX759rQIs27cAaXRAR</t:SubscriptionId>
        <t:PreviousWatermark>AQAAAPEcQws2E/hJu8etvqV1np+FUyIdAAAAAAE=</t:PreviousWatermark>
        <t:MoreEvents>false</t:MoreEvents>
        <t:ModifiedEvent>
         <t:Watermark>AQAAAPEcQws2E/hJu8etvqV1np/+VCIdAAAAAAE=</t:Watermark>
         <t:TimeStamp>2009-03-06T15:12:13Z</t:TimeStamp>
         <t:FolderId Id="AQMkADI0N2Q3YTQwLTUwNmUtNGYwOS05NGFmLWMwYTU0MDMyZWI1NwAuAAADIUSh8bRL+02VX9YTPqZgNAEAhqETHjXT2UqoWONyxxOnHQAIJDbd+wAAAA==" ChangeKey="AwAAAA==" />
         <t:ParentFolderId Id="AQMkADI0N2Q3YTQwLTUwNmUtNGYwOS05NGFmLWMwYTU0MDMyZWI1NwAuAAADIUSh8bRL+02VX9YTPqZgNAEAhqETHjXT2UqoWONyxxOnHQAIJDeVigAAAA==" ChangeKey="AQAAAA==" />
        </t:ModifiedEvent>
        <t:ModifiedEvent>
         <t:Watermark>AQAAAPEcQws2E/hJu8etvqV1np8AVSIdAAAAAAE=</t:Watermark>
         <t:TimeStamp>2009-03-06T15:12:13Z</t:TimeStamp>
         <t:ItemId Id="AAMkADI0N2Q3YTQwLTUwNmUtNGYwOS05NGFmLWMwYTU0MDMyZWI1NwBGAAAAAAAhRKHxtEv7TZVf1hM+pmA0BwCGoRMeNdPZSqhY43LHE6cdAAgkNt37AACGoRMeNdPZSqhY43LHE6cdAApE94yjAAA=" ChangeKey="EQAAAA==" />
         <t:ParentFolderId Id="AQMkADI0N2Q3YTQwLTUwNmUtNGYwOS05NGFmLWMwYTU0MDMyZWI1NwAuAAADIUSh8bRL+02VX9YTPqZgNAEAhqETHjXT2UqoWONyxxOnHQAIJDbd+wAAAA==" ChangeKey="AQAAAA==" />
        </t:ModifiedEvent>
       </m:Notification>
      </m:SendNotificationResponseMessage>
     </m:ResponseMessages>
    </m:SendNotification>
    Monday, March 9, 2009 3:25 PM

Answers

  • Hi,

    Thank you for contacting us and your interest in Exchange Development using Exchange Web Services (EWS).

    This forum is specific to the technical discussion around the content of the Exchange Server Protocols documentation
    .

    There is a helpful technical community on the Microsoft TechNet that is focused on Exchange Server development found here. The Exchange Server development forum would be a better place to ask your question.
    The forum covers topics such as web services, APIs, application conversion and general application development against Exchange Server.

    Developer Consultant
    Monday, March 9, 2009 5:33 PM
    Moderator