Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

SOAP/XML parsing issue with time format - does not use the format specified in CultureInfo.

$
0
0

I am parsing SOAP/XML response, in which there is a time field with the text '15:52:14.705+05:30'. Xamarin is not able to parse this XML and throws the following exception.

[mono] Unhandled Exception:

[mono] System.FormatException: Invalid format string

[mono] at System.DateTime.ParseExact (System.String s, System.String[] formats, IFormatProvider provider, DateTimeStyles style) [0x00000] in :0

[mono] at System.DateTime.ParseExact (System.String s, System.String format, IFormatProvider provider, DateTimeStyles style) [0x00000] in :0

[mono] at System.DateTime.ParseExact (System.String s, System.String format, IFormatProvider provider) [0x00000] in :0

[mono] at System.Xml.Serialization.XmlCustomFormatter.FromXmlString (System.Xml.Serialization.TypeData type, System.String value) [0x00000] in :0

It works fine when the time is in the format '15:52:14.7050000+05:30'.

I see that the format string is hardcoded at line # 280 of XmlCustomFormatter.cs

Is there a work around for this problem?

Should the time format be read from the CultureInfo classes?

Thanks,
Chandra.


Viewing all articles
Browse latest Browse all 58056

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>