1
votes

I have made a Windows Phone 8.1 app using cordova what is using PushPlugin for notifications. I've successfully subscribed to channel which has given something like this:

https://db3.notify.windows.com/?token=AwYAAACgzvv%2b6pMI9lq1oUFa3HF31%....

I tried to send a simple Toast notification (see below) with PHP but the Microsoft server has given Header 400 - Bad Request answer.

HTTP/1.1 400 Bad Request Content-Length: 0 X-WNS-MSG-ID: D5DAEFC56A10C79 X-WNS-DEBUG-TRACE: DB3WNS4011233 Strict-Transport-Security: max-age=31536000; includeSubDomains WWW-Authenticate: Bearer Date: Thu, 01 Oct 2015 09:20:48 GMT

'Content-Type: text/xml'

'Accept: application/*'

"X-NotificationClass: $delay"

<?xml version="1.0" encoding="utf-8"?>
<wp:Notification xmlns:wp="WPNotification">
    <wp:Toast>
        <wp:Text1>test</wp:Text1>
        <wp:Text2>test</wp:Text2>
    </wp:Toast>
</wp:Notification>
1

1 Answers

0
votes

In relation to Push Notification Service response codes for Windows Phone 8 your error occurs:

when the cloud service sends a notification request with a bad XML document or malformed notification URI.

But i am wondering, why your request answer includes something like "X-WNS-MSG-ID" and "X-WNS-DEBUG-TRACE", when you are using MPNS. Probably you are mixing WNS and MPNS in your Application...

Related to this issue, you will find further information here: Choosing MPNS or WNS for a Windows Phone Silverlight 8.1 app