WNS: The Notification payload is invalid

TRX 0 Reputation points
2025-11-04T05:34:06.86+00:00

I'm trying to send WNS toast notifications via Azure Notification Hubs, but every test fails with the error "The notification payload is invalid" (see screenshot). Raw notifications, however, are delivered successfully, which suggests the issue is on the server side. Could you help me troubleshoot the toast notification payload?

User's image

User's image

Azure Notification Hubs
Azure Notification Hubs
An Azure service that is used to send push notifications to all major platforms from the cloud or on-premises environments.
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Natheem Yousuf 340 Reputation points
    2025-11-13T05:34:17.6433333+00:00

    Hello TRX,

    let’s fix that payload.

    Most likely cause: the toast XML you sent isn’t a valid WNS toast template for the target Windows version/registration (or it has stray characters/BOM). Try the modern ToastGeneric payload (works on Win10+ UWP) — example you can paste in the portal:

    <?xml version="1.0" encoding="utf-8"?>
    <toast>
      <visual>
        <binding template="ToastGeneric">
          <text>Contoso</text>
          <text>Your test message here</text>
        </binding>
      </visual>
    </toast>
    

    If you target older Windows/Windows Phone templates use ToastText01/ToastText02 and include the correct <text id="1"> / <text id="2"> elements. Also check: (1) registration is for Windows platform (not raw-only), (2) your Notification Hub has valid WNS credentials, and (3) the payload has no hidden BOM/extra chars and is well-formed XML.

    If you want, paste the exact XML you tried and I’ll point out what’s wrong. Hope this helps — try this once.

    0 comments No comments

  2. TRX 0 Reputation points
    2025-11-19T12:36:20.5633333+00:00

    Hi Natheem,

    Thank you for your reply!

    I have configured the Package SID and Security Key for Windows (WNS) in ANH, and no other platforms are currently configured.

    Unfortunately, after using the payload you provided and double-checking for any errors, the issue persists.

    Could you please guide me on where to check if the registration is set to the "Windows platform" (rather than raw-only), as you mentioned?

    Best Regards,

    T.

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.