title: Windows phone 8 - Sending push notification works from Web Form but not from Phone
body: <p>I made a web service that can send push notification depending on <a href="https://msdn.microsoft.com/en-us/library/windows/apps/hh202967(v=vs.105).aspx" rel="nofollow">this tutorial</a>. When i call the function from a web form, it works perfectly. However,  when i call the same function from phone i don't receive the notification at all although the response is "Received | Active | Connected". The function is like this :</p>
  
  <pre><code>[WebMethod]
      public void SendNotification(string Title, string msg, string url)
      {
          try
          {
              string subscriptionUri = GetNotificationUrl();
  
             HttpWebRequest sendNotificationRequest = (HttpWebRequest) WebRequest.Create(subscriptionUri);
  
              sendNotificationRequest.Method = "POST";
  
              string toastMessage = "&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;" +
                                    "&lt;wp:Notification xmlns:wp=\"WPNotification\"&gt;" +
                                    "&lt;wp:Toast&gt;" +
                                    "&lt;wp:Text1&gt;" + Title + "&lt;/wp:Text1&gt;" +
                                    "&lt;wp:Text2&gt;" + msg + "&lt;/wp:Text2&gt;" +
                                    "&lt;wp:Param&gt;" + url + "&lt;/wp:Param&gt;" +
                                    "&lt;/wp:Toast&gt;&lt;/wp:Notification&gt;";
  
              byte[] notificationMessage = Encoding.Default.GetBytes(toastMessage);
  
              // Set the web request content length.
              sendNotificationRequest.ContentLength = notificationMessage.Length;
              sendNotificationRequest.ContentType = "text/xml";
              sendNotificationRequest.Headers.Add("X-WindowsPhone-Target", "toast");
              sendNotificationRequest.Headers.Add("X-NotificationClass", "2");
  
  
  
              using (Stream requestStream = sendNotificationRequest.GetRequestStream())
              {
                  requestStream.Write(notificationMessage, 0, notificationMessage.Length);
              }
  
              // Send the notification and get the response.
  
              HttpWebResponse response = (HttpWebResponse) sendNotificationRequest.GetResponse();
              string notificationStatus = response.Headers["X-NotificationStatus"];
              string notificationChannelStatus = response.Headers["X-SubscriptionStatus"];
              string deviceConnectionStatus = response.Headers["X-DeviceConnectionStatus"];
  
              WriteLog(notificationStatus + " | " + notificationChannelStatus + " | " +
                                                deviceConnectionStatus);
          }
          catch
          {
  
  
          }
      }
  </code></pre>