iframe header
  • Join FlightAware (Why Join?)
  • Login
  • US Flag 
02:40PM EDT

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: c# problem with authentication
PostPosted: Sat Jul 14, 2012 4:57 pm 
Offline

Joined: Tue Jul 10, 2012 6:59 am
Posts: 4
I try to use FlightXML in MS .NET (C#, Visual Studio 2010).
I add Service Reference with WSDL URL http://flightxml.flightaware.com/soap/FlightXML2/wsdl
And then I write simple code
Code:
            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.
Code:
The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header received from the server was 'Basic realm="FlightXML2"'.

Where is the problem? :?


Top
 Profile  
 
 Post subject: Re: c# problem with authentication
PostPosted: Mon Jul 16, 2012 10:46 am 
Offline
FlightAware Staff
bovineone - FlightAware user avatar

Joined: Wed Jul 27, 2005 3:00 am
Posts: 234
Location: FlightAware WHQ
Be sure you are using the FlightXML API key and not your website password. The API key is a long hexadecimal string.


Top
 Profile  
 
 Post subject: Re: c# problem with authentication
PostPosted: Mon Jul 16, 2012 11:08 am 
Offline

Joined: Tue Jul 10, 2012 6:59 am
Posts: 4
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.


Top
 Profile  
 
 Post subject: Re: c# problem with authentication
PostPosted: Mon Jul 16, 2012 11:24 am 
Offline
FlightAware Staff
bovineone - FlightAware user avatar

Joined: Wed Jul 27, 2005 3:00 am
Posts: 234
Location: FlightAware WHQ
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.

http://flightaware.com/commercial/fligh ... ation2.rvt


Top
 Profile  
 
 Post subject: Re: c# problem with authentication
PostPosted: Sat Jul 21, 2012 8:16 am 
Offline

Joined: Thu May 13, 2010 3:00 pm
Posts: 4
bovineone wrote:
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.

http://flightaware.com/commercial/fligh ... ation2.rvt

This is how I got it working. :)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
iframe sidebar


 

Airport Tracker/Info


-or-