title: Windows 8 push Notification 404 using PHP
body: <p>I'm sure <code>access_token</code> &amp; <code>sid &amp; secret</code>is right.</p>
  
  <p>I do not know what will cause 404 Error.</p>
  
  <p>This is my PHP code:</p>
  
  <pre><code>public function build_tile_xml($title, $img){
      return '&lt;?xml version="1.0" encoding="utf-8"?&gt;'.
      '&lt;toast launch="additionalContextParameters"&gt;'.
        '&lt;visual lang="en-US"&gt;'.
          '&lt;binding template="ToastImageAndText01"&gt;'.
            '&lt;text id="1"&gt;'.$title.'&lt;/text&gt;'.
          '&lt;/binding&gt;'.
        '&lt;/visual&gt;'.
      '&lt;/toast&gt;';
  }
  
  public function post_tile($uri, $xml_data, $type = WPNTypesEnum::Toast, $tileTag = ''){
      if($this-&gt;access_token == ''){
          $this-&gt;get_access_token();
      }
  
      $headers = array('Content-Type: text/xml', "Content-Length: " . strlen($xml_data), "X-WNS-Type: $type", "Authorization: Bearer $this-&gt;access_token");
  
      if($tileTag != ''){
          array_push($headers, "X-WNS-Tag: $tileTag");
      }
  
      $ch = curl_init($uri);
      // Tiles: http://msdn.microsoft.com/en-us/library/windows/apps/xaml/hh868263.aspx
      // http://msdn.microsoft.com/en-us/library/windows/apps/hh465435.aspx
      curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
      curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
      curl_setopt($ch, CURLOPT_POST, 1);
      curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
      curl_setopt($ch, CURLOPT_POSTFIELDS, "$xml_data");
      curl_setopt($ch, CURLOPT_VERBOSE, 1);
      curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
      $output = curl_exec($ch);
      $response = curl_getinfo( $ch );
      curl_close($ch);
  
      $code = $response['http_code'];
  
      if($code == 200){
          echo 'Successfully sent message'. "&lt;br&gt;";
          return new WPNResponse('Successfully sent message', $code);
      }
      else if($code == 401){
          echo '$code == 401' . "&lt;br&gt;";
          $this-&gt;access_token = '';
          return $this-&gt;post_tile($uri, $xml_data);
      }
      else if($code == 410 || $code == 404){
          echo 'Expired or invalid URI ' . $code . "&lt;br&gt;";
          return new WPNResponse('Expired or invalid URI ', $code, true);
      }
      else{
          echo 'Unknown error while sending message ' . $code . "&lt;br&gt;";
          return new WPNResponse('Unknown error while sending message', $code, true);
      }
  }`
  </code></pre>