locked
Notification Hub Bulk Import Failing with “Bad Format” error RRS feed

  • Question

  • I have followed the sample code provided by Microsoft at the following location:https://docs.microsoft.com/en-us/previous-versions/azure/azure-services/dn790624(v=azure.100)

    When I create the job NotificationHubJobType.ImportCreateRegistrations everything runs and completes without an error. However when I look at the output created by the job I have a failure file with every registration listed as follows:

    <AppleRegistrationDescription xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/netservices/2010/10/servicebus/connect"><RegistrationId i:nil="true" /><DeviceToken>1234</DeviceToken></AppleRegistrationDescription>,BadRequest,Bad Format

    Notice at the end it says "BadRequest,Bad Format". I do not know what this if referring to or how to fix it. Here is a sample from my input file:

    <AppleRegistrationDescription xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/netservices/2010/10/servicebus/connect"><RegistrationId i:nil="true" /><DeviceToken>1234</DeviceToken></AppleRegistrationDescription>
    <AppleRegistrationDescription xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/netservices/2010/10/servicebus/connect"><RegistrationId i:nil="true" /><DeviceToken>4321</DeviceToken></AppleRegistrationDescription>

    Any help or suggestions would be greatly appreciated.

    Thursday, April 4, 2019 9:04 PM

Answers

All replies

  • Hi,

    Thanks for raising this issue. I will investigate and update here.

    Friday, April 5, 2019 11:00 AM
  • Hi,

    We apologize for the inaccuracy in the document, we are in a process of fixing it. Can you please try to useNotificationHub SDK instead of Service Bus SDK mentioned in the document.

    Also, the XML should look like:

    <RegistrationDescription xmlns:i="http://www.w3.org/2001/XMLSchema-instance", Type=”AppleRegistrationDescription” xmlns="http://schemas.microsoft.com/netservices/2010/10/servicebus/connect"><RegistrationId i:nil="true" /><DeviceToken>1234</DeviceToken></AppleRegistrationDescription>

    Monday, April 8, 2019 6:09 PM
  • Thank you for the reply. I appreciate you looking into this issue. However, I am using the NotificationHub SDK to perform all Notification Hub tasks. I am using Microsoft.Azure.NotificationHubs NuGet package version 3.0.2.

    The following code is what is giving me the incorrect XML format:

    var registration = new AppleRegistrationDescription("1234");
    var xmlString = registration.Serialize();

    Is this a problem with the library version 3.0.2? (it is listed as the latest version).

    Wednesday, April 10, 2019 9:49 PM
  • Hi,

    Latest version is not working with bulk updates and we are fixing it. Can you please use Notification hubs version - 1.0.9.

    https://www.nuget.org/packages/Microsoft.Azure.NotificationHubs/1.0.9

    Thursday, April 11, 2019 2:50 AM