I have some problems with my php service. I use php for send Tile update and Toast update requests to MS Notification Service. After first request in response I have following headers:
URL: http://db3.notify.live.net/throttledthirdparty/01.00/AAHFGdPCYDOUSbbzeTpjKOMZAgAAAAADAQAAAAQUZm52OjIzOEQ2NDJDRkI5MEVFMEQ
RESPONSE:
HTTP/1.1 200 OK
Cache-Control: private
Server: Microsoft-IIS/7.5
X-DeviceConnectionStatus: Connected
X-NotificationStatus: Received
X-SubscriptionStatus: Active
X-MessageID: da8aa692-e9cd-682b-fe1c-22ffe7379414
ActivityId: cd9c8b0开发者_JS百科b-26db-4eac-835d-9f9505d7a381
X-Server: DB3MPNSM016
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Wed, 20 Jul 2011 11:21:42 GMT
Content-Length: 0
Array ( [X-SubscriptionStatus] => Active [X-NotificationStatus] => Received [X-DeviceConnectionStatus] => Connected )
But in my WP7 app I have nothing. When I try update tile again:
URL: http://db3.notify.live.net/throttledthirdparty/01.00/AAHFGdPCYDOUSbbzeTpjKOMZAgAAAAADAQAAAAQUZm52OjIzOEQ2NDJDRkI5MEVFMEQ
RESPONSE:
HTTP/1.1 404 Not Found
Cache-Control: private
Content-Type: text/html
Server: Microsoft-IIS/7.5
X-DeviceConnectionStatus: Disconnected
X-NotificationStatus: Dropped
X-SubscriptionStatus: Expired
X-MessageID: {B6AAC154-DA37-277F-14FE-9F76365ACDD1}
ActivityId: f6b6a06b-a836-449c-9c9b-dc3033850981
X-Server: DB3MPNSM033
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Wed, 20 Jul 2011 11:29:34 GMT
Content-Length: 1245
It seems that after first request my url was deleted.
I do not have any problems in my WP7 app because when I use WindowsService all works fine.
It seems that my problem similar to problem [question]: Windows Phone 7 Push Notifications Not Showing Up On My Phone
Check your XML carefully. I have got exact same behavior with unclosed tag.
After wasting some time trying to fix an XML that had nothing wrong in it (due to answers that suggested 404 error code is caused by invalid XML), I feel the need to share my findings.
Sending an invalid XML in a notification for the first time will not be immediately identified in the response (i.e. the response will be 200/Received/Active/Connected even though the notification won't reach the device).
However, the next time you try to send a notification to that channel (whether it has a valid or invalid XML), you'll find that the channel is no longer valid (i.e. the response will be 404).
The channel becomes invalid due to the previously sent invalid message.
Which means, if you get this error you have to first get a new notification channel (by launching your app, which should initiate a subscription to the MPN service).
Only then you should verify the correctness of your XML and try to send the notification to the new channel. This time you'll get a 200 status again, and the only way to know if the XML was valid is to check if the notification reached the device.
精彩评论