Hi, I followed the C# Example verbatim on Visual Studio 2015 - I added the service reference flightxml.flightaware.com/soap/FlightXML2/wsdl), copied the code over using my username and API Key, and got everything compiling. However, I am getting the following error when I execute the test method:
System.ServiceModel.EndpointNotFoundException: There was no endpoint listening at flightxml.flightaware.com/soap/FlightXML2/wsdl that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.
System.Net.WebException: Unable to connect to the remote serverSystem.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
Anyone have any ideas?
Here is a cut and paste of my code:
app.config:
<system.serviceModel>
</system.serviceModel>
C# Code:
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Atsg.Tests.FlightXML2;
namespace Atsg.Tests.Web
{
[TestClass]
public class UnitTest1
{
[TestMethod]
public void TestMethod1()
{
FlightXML2SoapClient client = new FlightXML2SoapClient();
client.ClientCredentials.UserName.UserName = “MyUserName”;
client.ClientCredentials.UserName.Password = “MyApiKey”;
EnrouteStruct r = client.Enroute("KHOU", 10, "", 0);
foreach (EnrouteFlightStruct e in r.enroute)
{
Console.WriteLine(e.ident);
}
Console.WriteLine(client.Metar("KAUS"));
}
}
}