FlightAware Discussions

Invalid Operation

If I know an airport (RJTT) and an actual arrival time (1432116840) and I format a request to MetarEx as follows (C# console app)…

ArrayOfMetarStruct oms = df.MetarEx(z.origin, z.actualdeparturetime, 1, 0);

I want to get the closest METAR report for that airport to that arrival time.

I’m getting an exception as follows and I’m not sure why ?

invalid operation: System.InvalidOperationException: There is an error in XML document (2, 802). —> System.FormatException: Input string was not in a correct format.
at System.Number.ParseSingle(String value, NumberStyles options, NumberFormatInfo numfmt)
at System.Single.Parse(String s, NumberStyles style, IFormatProvider provider)
at System.Xml.XmlConvert.ToSingle(String s)
at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderFlightXML2.Read4_MetarStruct(Boolean isNullable, Boolean checkType)
at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderFlightXML2.Read5_ArrayOfMetarStruct(Boolean isNullable, Boolean checkType)
at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderFlightXML2.Read108_MetarExResults()
at Microsoft.Xml.Serialization.GeneratedAssembly.ArrayOfObjectSerializer134.Deserialize(XmlSerializationReader reader)
at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)
— End of inner exception stack trace —
at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)
at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle)
at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object] parameters)
at FlightXML2.MetarEx(String airport, Int32 startTime, Int32 howMany, Int32 offset)
at Flightaware1.Program.Main(String] args) in c:\faware\Flightaware1\Flightaware1\Flightaware1\faextract.cs:line 4608

Thanks for any help.

This was caused by the pressure (altimeter setting) not being present in some METAR reports, which was causing a null value to trigger an error. We believe the problem should be fixed on our servers in tomorrow’s code release (approximately 4pm Central time).

Thanks. That’s Great!