public ATCFlightPlan GetATCFlightPlan(int fltsegid)
{
ATCFlightPlan atcFlightPlan = null;
//Create connection to FlightPlanService
WSHttpBinding httpBind = new WSHttpBinding();
ChannelFactory
IFlightPlanProcessManager flightPlanProcessManagerClient = flightPlanProcessServiceFactory.CreateChannel();
using (flightPlanProcessManagerClient as IDisposable)
{
try
{
atcFlightPlan = flightPlanProcessManagerClient.GetATCFlightPlan(fltsegid);
}
catch (FaultException ex)
{
EventLog.WriteEntry("FlightPlanBroker", "Fault Exception thrown from Primary FlightPlanSvc: " + ex.ToString());
throw;
}
catch (Exception ex)
{
EventLog.WriteEntry("FlightPlanBroker", "Error communicating with Primary FlightPlanSvc: " + ex.ToString());
ChannelFactory
IFlightPlanProcessManager backupFlightPlanProcessManagerClient = backupFlightPlanProcessServiceFactory.CreateChannel();
using (backupFlightPlanProcessManagerClient as IDisposable)
{
try
{
atcFlightPlan = backupFlightPlanProcessManagerClient.GetATCFlightPlan(fltsegid);
FailOverEndpoints();
}
catch (FaultException innEx)
{
EventLog.WriteEntry("FlightPlanBroker", "Fault Exception thrown from Backup FlightPlanSvc: " + innEx.ToString());
throw;
}
catch (Exception innEx)
{
EventLog.WriteEntry("FlightPlanBroker", "Error communicating with backup FlightPlanSvc: " + innEx.ToString());
throw;
}
}
}
}
return atcFlightPlan;
}
No comments:
Post a Comment