var conn = new FlightXML2.FlightXML2SoapClient();
conn.ClientCredentials.UserName.UserName = "UserName";
conn.ClientCredentials.UserName.Password = "*****";
conn.Open();
Console.WriteLine( conn.Metar("KAUS") );
conn.Close();
But I have authentication error, when program calls Metar method.
The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header received from the server was 'Basic realm="FlightXML2"'.
Yes, I am sure, I use my site login and key.
I have generated two keys, the first with “FlightAware Base Flight Tracking Data” access, the second with “FlightAware Base Flight Tracking Data + Airline Schedules, Gate Assignments, and Gate Times + Australian Airspace”. I have tried both keys, in c# it doesn’t work, but in JS sample it works normally.
Have you tried building the stubs by manually running the wsdl.exe utility and passing the credentials as described on our documentation page? I think there are limitations with simply adding the WSDL to Visual Studio as a service reference.