Xml问题发送Toast通知到运行WP7应用程序

时间:2010-11-01 22:46:46

标签: windows-phone-7 push-notification toast mpns

民间,   我有WP7运行的示例应用程序。我也有一个服务(WCF),我有一个推送通知发送者(WPF)。到目前为止,这看起来与微软在WP7培训套件中设置的推送通知安排非常相似。当我启动应用程序然后退出应用程序返回主屏幕时,我能够成功发送一个Toast通知 - 它显示在顶部,发出一点噪音,显示正确的文本,并在您启动我的应用程序时点击它。

但是,当我在应用程序在前台运行时向我的应用程序发送相同的shell toast通知时,我收到一个错误,抱怨根XML节点存在无效字符。此错误发生在WP7的内部深处,因为我的toast通知处理程序从未被调用过,调试器无法显示生成错误的代码行。

我正在使用培训套件中WP7推送通知示例附带的NotificationSenderUtility来发送通知。

如果有人知道为什么会这样或者我如何解决它,我很想知道,因为我有一个演示,我在星期六在代码阵营给予推送通知应该是演示的一部分:)

这是我得到的堆栈跟踪:

在System.Xml.XmlTextReaderImpl.Throw(例外e)    在System.Xml.XmlTextReaderImpl.Throw(Int32 res,String resString,String [] args)    在System.Xml.XmlTextReaderImpl.Throw(Int32 res,String resString)    在System.Xml.XmlTextReaderImpl.ParseRootLevelWhitespace()    在System.Xml.XmlTextReaderImpl.ParseDocumentContent()    在System.Xml.XmlTextReaderImpl.Read()    在Microsoft.Phone.Notification.ShellObjectChannelInternals.ParseXMLToProperties(String xmlString,IDictionary`2& propertyBag)    在Microsoft.Phone.Notification.ShellObjectChannelInternals.OnNotificationReceived(IntPtr blob,UInt32 blobSize)    在Microsoft.Phone.Notification.ShellObjectChannelInternals.ChannelHandler(UInt32 eventType,IntPtr blob1,UInt32 blobSize1,IntPtr blob2,UInt32 blobSize2)    在Microsoft.Phone.Notification.HttpNotificationChannel.Dispatch(Object threadContext)    在System.Threading.ThreadPool.WorkItem.doWork(Object o)    在System.Threading.Timer.ring()


谢谢,   凯文

1 个答案:

答案 0 :(得分:2)

检查客户端和发件人的代码是否符合最新文档。测试期间规范发生了变化。

How to: Send a Push Notification from a Web Service for Windows Phone

How to: Set Up a Notification Channel for Windows Phone

您在培训套件中使用的工具/代码可能尚未达到规范。

相关问题