BingMapsRESTToolkit icon indicating copy to clipboard operation
BingMapsRESTToolkit copied to clipboard

There was an error deserializing the object of type BingMapsRESTToolkit.Response. The string '1:00u' was not recognized as a valid DateTime. There is an unknown word starting at index '4'

Open sndnnlfhvk opened this issue 2 years ago • 1 comments

error

Response :

{
    "authenticationResultCode": "ValidCredentials",
    "brandLogoUri": "http:\/\/dev.virtualearth.net\/Branding\/logo_powered_by.png",
    "copyright": "Copyright © 2023 Microsoft and its suppliers. All rights reserved. This API cannot be accessed and the content and any results may not be used, reproduced or transmitted in any manner without express written permission from Microsoft Corporation.",
    "resourceSets": [
        {
            "estimatedTotal": 1,
            "resources": [
                {
                    "__type": "RESTTimeZone:http:\/\/schemas.microsoft.com\/search\/local\/ws\/rest\/v1",
                    "timeZone": {
                        "genericName": "Central European Standard Time",
                        "abbreviation": "CET",
                        "ianaTimeZoneId": "Europe\/Warsaw",
                        "windowsTimeZoneId": "Central European Standard Time",
                        "utcOffset": "1:00",
                        "convertedTime": {
                            "localTime": "2023-03-07T10:55:20",
                            "utcOffsetWithDst": "1:00",
                            "timeZoneDisplayName": "Central European Standard Time",
                            "timeZoneDisplayAbbr": "CET"
                        },
                        "dstRule": {
                            "dstStartMonth": "Mar",
                            "dstStartDateRule": "lastSun",
                            **"dstStartTime": "1:00u",**
                            "dstAdjust1": "1:00",
                            "dstEndMonth": "Oct",
                            "dstEndDateRule": "lastSun",
                            **"dstEndTime": "1:00u",**
                            "dstAdjust2": "0"
                        }
                    }
                }
            ]
        }
    ],
    "statusCode": 200,
    "statusDescription": "OK",
    "traceId": "60902ad665f54cc19b80d704d037a6cb|CO00004BD7|0.0.0.1"
}

from the json response ,we can see :

"dstStartTime": "1:00u" "dstEndTime": "1:00u"

 /// <summary>
        /// The local time when DST starts, hh:mm format
        /// </summary>
        [DataMember(Name = "dstEndTime", EmitDefaultValue = false)]
        public string DstEndTime
        {
            get
            {
                return DateTimeHelper.GetUTCString(EndTime);
            }
            set
            {
                EndTime = DateTimeHelper.GetDateTimeFromUTCString(value);
            }
        }

dstStartTime and dstEndTime value "1:00u" is not a valid DateTime .

sndnnlfhvk avatar Mar 07 '23 13:03 sndnnlfhvk

This looks like a breaking change in the service as the documentation for these properties say the format is "(+/-)h:mm". I recommend reporting this issue at the Bing Maps Enterprise support team here: https://www.microsoft.com/en-us/maps/support

rbrundritt avatar Mar 07 '23 15:03 rbrundritt