在Windows Phone 8中调用voip代理,服务器需要通过MPNS发送带有以下有效负载的类型4原始通知。
HttpWebRequest sendNotificationRequest = (HttpWebRequest)WebRequest.Create(subscriptionUri);
sendNotificationRequest.Method = "POST";
// We will create a HTTPWebRequest that posts the raw notification to the Microsoft Push Notification Service.
// HTTP POST is the only allowed method to send the notification.
// Create the raw message.
string rawMessage = "<?xml version=\"1.0\" encoding=\"utf-8\"?>" + "<root></root>";
// Sets the notification payload to send.
byte[] notificationMessage = Encoding.Default.GetBytes(rawMessage);
// Sets the web request content length.
sendNotificationRequest.ContentLength = notificationMessage.Length;
sendNotificationRequest.ContentType = "text/xml";
sendNotificationRequest.Headers.Add("X-NotificationClass", "4");
using (Stream requestStream = sendNotificationRequest.GetRequestStream())
{
requestStream.Write(notificationMessage, 0, notificationMessage.Length);
}
使用WNS作为通知服务启动voip代理的推送有效负载是什么?