Receiving "MessageBadContent error" without remote URIs in payload

Category: windows phone push

Question

PubNubInc on Mon, 27 Oct 2014 23:10:52


I have a simple windows phone app (built from the basic windows phone template wizard) and I added the necessary code for tile push notification support - copied from http://msdn.microsoft.com/en-us/library/windows/apps/hh202970(v=vs.105).aspx.  The app is configured for "cycle" tile template.

The following curl command is used to try and update the tile and count:

curl -v -H "Content-Type:text/xml" -H "X-WindowsPhone-Target:token" -H "X-NotificationClass:1" -X POST -d "<?xml version='1.0' encoding='utf-8'?><wp:Notification xmlns:wp='WPNotification'><wp:Count>1</wp:Count><wp:Title>cycle1</wp:Title></wp:Tile></wp:Notification>" http://sn1.notify.live.net/throttledthirdparty/01.00/AQFrfOu7PkkxTbcijlZI9BSRAgAAAAADBQAAAAQUZm52OkRFNzg2NTMxMzlFMEZFNkMFBlVTU0MwMQ

And the output:

* Adding handle: conn: 0x7f811a804000
* Adding handle: send: 0
* Adding handle: recv: 0
* Curl_addHandleToPipeline: length: 1
* - Conn 0 (0x7f811a804000) send_pipe: 1, recv_pipe: 0
* About to connect() to sn1.notify.live.net port 80 (#0)
*   Trying 157.56.174.124...
* Connected to sn1.notify.live.net (157.56.174.124) port 80 (#0)
> POST /throttledthirdparty/01.00/AQFrfOu7PkkxTbcijlZI9BSRAgAAAAADBQAAAAQUZm52OkRFNzg2NTMxMzlFMEZFNkMFBlVTU0MwMQ HTTP/1.1
> User-Agent: curl/7.30.0
> Host: sn1.notify.live.net
> Accept: */*
> Content-Type:text/xml
> X-WindowsPhone-Target:token
> X-NotificationClass:1
> Content-Length: 158
>
* upload completely sent off: 158 out of 158 bytes
< HTTP/1.1 200 OK
< Cache-Control: private
* Server Microsoft-IIS/7.5 is not blacklisted
< Server: Microsoft-IIS/7.5
< X-DeviceConnectionStatus: Connected
< X-NotificationStatus: Received
< X-SubscriptionStatus: Active
< X-MessageID: 00000000-0000-0000-0000-000000000000
< ActivityId: 92bda181-2e13-4e63-b154-bc35a2ffbfb8
< X-Server: SN1MPNSM058
< X-AspNet-Version: 4.0.30319
< X-Powered-By: ASP.NET
< Date: Mon, 27 Oct 2014 23:04:13 GMT
< Content-Length: 0
<
* Connection #0 to host sn1.notify.live.net left intact

The app is running on Nokia Lumia 520 WP 8.0.  After the curl command, an error dialog appears on the app screen (not verbatim):

A push notification MessageBadContent error occurred. A remote URL was specified in the tile notification payload and one of the following conditions was not met: 1) It was not http://, 2) the host name exceeded 256 characters, 3) the URL exceeded 2055 characters, 4) the domain was not specified in the allowed domains collection. (-2129589899) 0"

Why is it complaining about a remote URL if none was specified in the push payload?  My pinned tile on the home screen does not show the updated title or count either.

Thanks for your assistance.

Dara.



Replies

PubNubInc on Mon, 27 Oct 2014 23:14:37


I also tried sending "Clear" attribute in case an old value is "stuck".  But the same error appears.  (note - this has a different device URI than my previous example - the app generated a new one)

curl -v -H "Content-Type:text/xml" -H "X-WindowsPhone-Target:token" -H "X-NotificationClass:1" -X POST -d "<?xml version='1.0' encoding='utf-8'?><wp:Notification xmlns:wp='WPNotification'><wp:Tile><wp:CycleImage1 Action='Clear'></wp:CycleImage1><wp:CycleImage2 Action='Clear'></wp:CycleImage2><wp:CycleImage3 Action='Clear'></wp:CycleImage3><wp:CycleImage4 Action='Clear'></wp:CycleImage4><wp:CycleImage5 Action='Clear'></wp:CycleImage5><wp:CycleImage6 Action='Clear'></wp:CycleImage6><wp:CycleImage7 Action='Clear'></wp:CycleImage7><wp:CycleImage8 Action='Clear'></wp:CycleImage8><wp:CycleImage9 Action='Clear'></wp:CycleImage9><wp:Count>22</wp:Count><wp:Title>cycle22</wp:Title></wp:Tile></wp:Notification>" http://sn1.notify.live.net/throttledthirdparty/01.00/AQFrfOu7PkkxTbcijlZI9BSRAgAAAAADBgAAAAQUZm52OkRFNzg2NTMxMzlFMEZFNkMFBlVTU0MwMQ

* Adding handle: conn: 0x7fcfdb804000
* Adding handle: send: 0
* Adding handle: recv: 0
* Curl_addHandleToPipeline: length: 1
* - Conn 0 (0x7fcfdb804000) send_pipe: 1, recv_pipe: 0
* About to connect() to sn1.notify.live.net port 80 (#0)
*   Trying 157.56.174.124...
* Connected to sn1.notify.live.net (157.56.174.124) port 80 (#0)
> POST /throttledthirdparty/01.00/AQFrfOu7PkkxTbcijlZI9BSRAgAAAAADBgAAAAQUZm52OkRFNzg2NTMxMzlFMEZFNkMFBlVTU0MwMQ HTTP/1.1
> User-Agent: curl/7.30.0
> Host: sn1.notify.live.net
> Accept: */*
> Content-Type:text/xml
> X-WindowsPhone-Target:token
> X-NotificationClass:1
> Content-Length: 601
>
* upload completely sent off: 601 out of 601 bytes
< HTTP/1.1 200 OK
< Cache-Control: private
* Server Microsoft-IIS/7.5 is not blacklisted
< Server: Microsoft-IIS/7.5
< X-DeviceConnectionStatus: Connected
< X-NotificationStatus: Received
< X-SubscriptionStatus: Active
< X-MessageID: 00000000-0000-0000-0000-000000000000
< ActivityId: 727db98f-3bca-4fd0-9362-679fcb497774
< X-Server: SN1MPNSM070
< X-AspNet-Version: 4.0.30319
< X-Powered-By: ASP.NET
< Date: Mon, 27 Oct 2014 23:13:19 GMT
< Content-Length: 0
<
* Connection #0 to host sn1.notify.live.net left intact

Alan_Yao on Tue, 28 Oct 2014 08:58:44


Hi,

I think it might be caused by the command you used.

Could you please double check the messege you sent?

I just found there is no pair for </wp:Tile> in your first command. Could you please verify it is a valid XML before sending and use a very simple sample for test purpose?


<THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
Thanks
Alan Yao
MSDN Community Support

Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.




PubNubInc on Fri, 31 Oct 2014 19:48:18


Thanks Alan, that was a mistake on my part as I tried to create a stripped down example.

However, even after I fixed up the XML, I was still having the same error appear.

I was able to get it working by creating a fresh project with the same code - not sure why that worked.