# FlightXML2SoapClient not working

**URL:** <https://discussions.flightaware.com/t/flightxml2soapclient-not-working/34127>\
**Category:** AeroAPI\
**Created:** [April 18, 2018, 6:19am UTC](https://discussions.flightaware.com/t/flightxml2soapclient-not-working/34127 "2018-04-18T06:19:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeraldc](https://sea1.discourse-cdn.com/flex019/user_avatar/discussions.flightaware.com/jeraldc/32/13857_2.png) [@jeraldc](https://discussions.flightaware.com/u/jeraldc)\
**Post date:** [April 18, 2018, 6:19am UTC](https://discussions.flightaware.com/t/flightxml2soapclient-not-working/34127/1 "2018-04-18T06:19:26Z")

</div>

public void GetFlight()  
{  
ServiceReference1.FlightXML2SoapClient client = new ServiceReference1.FlightXML2SoapClient();  
client.ClientCredentials.UserName.UserName = “username”;  
client.ClientCredentials.UserName.Password = “password”;

```
        var r = client.AirlineFlightSchedules(1357830291, 1357916691, "KJFK","","","",3,0);
        //foreach (ServiceReference1.EnrouteFlightStruct e in r.enroute)
        //{
        // Console.WriteLine(e.ident);
        //}
        
    }

```

It gives me this error  
Additional information: The HTTP request is unauthorized with client authentication scheme ‘Anonymous’. The authentication header received from the server was ‘Basic realm=“FlightXML2”’.

---

<div class="post-metadata">

**Author:** ![bovineone](https://sea1.discourse-cdn.com/flex019/user_avatar/discussions.flightaware.com/bovineone/32/117631_2.png) [@bovineone](https://discussions.flightaware.com/u/bovineone)\
**Post date:** [June 6, 2019, 10:35pm UTC](https://discussions.flightaware.com/t/flightxml2soapclient-not-working/34127/2 "2019-06-06T22:35:19Z")

</div>

Were you able to figure out your problem? Be sure that the Password is your FlightXML API key, and not your FlightAware website password.
