/// <summary>
        /// Find type from xml string, and it should set to WnsHeaders["X-WNS-Type"];
        /// If the header already there, this function won't overwrite.
        /// </summary>
        private static void SetMpnsType(this MpnsTemplateRegistrationDescription registration)
        {
            if (registration == null || registration.IsJsonObjectPayLoad())
            {
                return;
            }

            if (registration.MpnsHeaders != null && registration.MpnsHeaders.ContainsKey(MpnsRegistrationDescription.NotificationClass))
            {
                int notificationClass = Int32.Parse(registration.MpnsHeaders[MpnsRegistrationDescription.NotificationClass], CultureInfo.InvariantCulture);
                if ((notificationClass >= 3 && notificationClass <= 10) ||
                    (notificationClass >= 13 && notificationClass <= 20) ||
                    (notificationClass >= 23 && notificationClass <= 31))
                {
                    // raw type
                    return;
                }
            }

            if (registration.IsXmlPayLoad())
            {
                if (registration.MpnsHeaders == null)
                {
                    registration.MpnsHeaders = new MpnsHeaderCollection();
                }

                switch (DetectMpnsTemplateRegistationType(registration.BodyTemplate, SRClient.NotSupportedXMLFormatAsBodyTemplateForMpns))
                {
                case MpnsTemplateBodyType.Tile:
                    AddOrUpdateHeader(registration.MpnsHeaders, MpnsRegistrationDescription.Type, MpnsRegistrationDescription.Tile);
                    AddOrUpdateHeader(registration.MpnsHeaders, MpnsRegistrationDescription.NotificationClass, MpnsRegistrationDescription.TileClass);
                    break;

                case MpnsTemplateBodyType.Toast:
                    AddOrUpdateHeader(registration.MpnsHeaders, MpnsRegistrationDescription.Type, MpnsRegistrationDescription.Toast);
                    AddOrUpdateHeader(registration.MpnsHeaders, MpnsRegistrationDescription.NotificationClass, MpnsRegistrationDescription.ToastClass);
                    break;
                }
            }
        }