本文介绍了订阅HealthVault活动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 您好, 我正在尝试订阅HealthVault事件,以便每次添加新的血压值时都会通知我。我有以下代码来创建订阅(取自HealthVault Eventing Sample): NotificationAuthenticationSharedKeyInfo sharedKeyInfo = new NotificationAuthenticationSharedKeyInfo(" TestVersion-1"); sharedKeyInfo.Key = Convert.FromBase64String(ConfigurationManager.AppSettings [" HVEventingSharedKeyValue"]); CommonSubscriptionData common = new CommonSubscriptionData( new HttpNotificationChannel(new Uri(" https:// localhost:44303 / notificationhandlerPage.ashx")),sharedKeyInfo); HealthRecordItemChangedSubscription subscription = new HealthRecordItemChangedSubscription(common); HealthRecordItemChangedFilter filter = new HealthRecordItemChangedFilter(); filter.TypeIds.Add(BloodPressure.TypeId); subscription.Filters.Add(过滤器); _manager.Subscribe(subscription); 但是当我执行它时,我在最后一行代码中得到以下错误: 订阅应用程序操作网址必须包含在顶级域和至少一个子域中。 什么我的网址有问题吗?我可以使用localhost作为通知的URL吗? 感谢您的帮助。 解决方案 您好Maxufly, 您无法使用本地主机地址,因为您要求HealthVault发送您的服务器事件。 URL需要解析为Internet上可访问的地址才能生效。 -Sean Hello,I am trying to subscribe to a HealthVault event so that I am notified every time a new Blood Pressure value is added. I have the following code to create the subscription (taken from the HealthVault Eventing Sample):NotificationAuthenticationSharedKeyInfo sharedKeyInfo = new NotificationAuthenticationSharedKeyInfo("TestVersion-1"); sharedKeyInfo.Key = Convert.FromBase64String(ConfigurationManager.AppSettings["HVEventingSharedKeyValue"]); CommonSubscriptionData common = new CommonSubscriptionData( new HttpNotificationChannel(new Uri("https://localhost:44303/notificationhandlerPage.ashx")), sharedKeyInfo); HealthRecordItemChangedSubscription subscription = new HealthRecordItemChangedSubscription(common); HealthRecordItemChangedFilter filter = new HealthRecordItemChangedFilter(); filter.TypeIds.Add(BloodPressure.TypeId); subscription.Filters.Add(filter); _manager.Subscribe(subscription);But when I execute it I get the following error in the last line of code:Subscribing application action urls must include at top level domain and at least one sub domain.What is wrong with my URL? Can I use localhost as URL for my notifications?Thanks for your help. 解决方案 Hi Maxufly,You can't use the local host address because you are asking HealthVault to send your server events. The URL needs to resolve to a reachable address on the Internet for this to work.-Sean 这篇关于订阅HealthVault活动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!