Cold Fusion Code Has Just Stopped Working

My Cold Fusion code has stopped working after five years of no problems. Here is the CF code…




What has changed? Thanks for your help.

Hi,
Does your program give you any error?
I have to say right now FlightInfo for your ident N999RN will return “no data available” response because the last flight happened about 3 weeks ago.
That is the last flight we have record of:
https://flightaware.com/live/flight/N999RN
The documentation says that The oldest flights searched by this function are about 2 weeks in the past. : https://flightxml.flightaware.com/soap/FlightXML2/doc#op_FlightInfo

Let us know if this is the error that you are getting. Otherwise, we will look for ColdFusion specific problems.

Yes, here is the error message using ident = ‘n501cp’ an aircraft with recent flights.

Diagnostics: Unable to read WSDL from URL: flightaware.com/commercial/fligh … /wsdl1.xml. Error: 598 Unknown Error. It is recommended that you use a web browser to retrieve and examine the requested WSDL document to ensure it is correct.

I also tried the new soap service at flightxml.flightaware.com/soap/FlightXML2/wsdl which also does not work. Your Cold Fusion examples don;t work either.

Thanks for any help you can give

I was able to successfully run a test in ColdFusion 11. What version of ColdFusion are you using?
Now this works with the old wsdl. I have a loop for printing Enroute and also your FlightInfo.


<cfscript>
    stAuth = structNew();
    stAuth.username = "username";
    stAuth.password = "***";
    ws = createObject("webservice", "http://flightaware.com/commercial/flightxml/data/wsdl1.xml", stAuth);

    stEnroute = structNew();
    stEnroute.airport = "KSFO";
    stEnroute.howMany = 15;
    stEnroute.filter = "";
    stEnroute.offset = 0;
    aEnrouteStruct = ws.Enroute(stEnroute);

	//-- Flight Info Stuff

	finfoIn = structNew();
	finfoIn.ident = "N501CP";
    finfoIn.howMany = 15;
	finfoOut = ws.FlightInfo(finfoIn);
</cfscript>

<cfset EnrouteFlights = aEnrouteStruct.getEnroute()>
<cfset flinfo = finfoOut.getFlights()>
<cfloop from="1" to="#ArrayLen(EnrouteFlights)#" index="i">
    <cfset dtime = DateAdd("s",EnrouteFlights*.actualdeparturetime,DateConvert("utc2Local", "January 1 1970 00:00"))>
	<cfoutput>
		#dtime#
		#EnrouteFlights*.ident#
		#EnrouteFlights*.actualdeparturetime#
		#EnrouteFlights*.estimatedarrivaltime#
		#EnrouteFlights*.filed_departuretime#
		#EnrouteFlights*.origin#
		#EnrouteFlights*.destination#
		#EnrouteFlights*.originName#
		#EnrouteFlights*.originCity#
		#EnrouteFlights*.destinationName#
		#EnrouteFlights*.destinationCity#
	</cfoutput>
</cfloop>


<cfoutput>	Flight Info: </cfoutput>
<!-- /n Flight Info Stuff -->
<cfloop from="1" to="#ArrayLen(flinfo)#" index="i">
	<cfoutput>
		#flinfo*.ident#
		#flinfo*.aircrafttype#
		#flinfo*.actualdeparturetime#
		#flinfo*.originCity#
		#flinfo*.originName#
	</cfoutput>
</cfloop>

We will try to have a working CF example for the new wsdl soon. I’ll let you know. Would you like to transition to version 2 of FlightXML?****************

Thanks for the great work on this. I am using Cold fusion 10. Any luck getting that to work?

Yes I would like a solution for the new Version 2 of FlightXML.

It does not look like you will be able to use the newest version of FlightXML wsdl since Adobe has not fixed this 1 year old bug:
https://bugbase.adobe.com/index.cfm?event=bug&id=3919057

In the meantime I would suggest upgrading to ColdFusion 11 and trying the code I posted above with the old wsdl. That worked for me.
We intent to stop providing the old FlightXML services soon though. Would you like to try another language with hopefully a better support?

Can you confirm the XML Revision 2 code works with CF 11? If so, the simple solution is to probably move to CF 11,although that may inject a host of other problems. Thanks again.

I could only get ColdFusion 11 to work with the first FlightXML: https://flightaware.com/commercial/flightxml/data/wsdl1.xml and even this fails at times.
I am afraid the bug that exists in ColdFusion10 got transferred to ColdFusion11.

But since we intend to retire this first version soon, you definitely need another alternative.
How do you feel about start using FlightXML2 with REST protocol? It should work on ColdFusion10.
I tried the example here and it works fine. I tested for Enroute and then for FlightInfo:


<cfhttp
    method="get"
    url="https://flightxml.flightaware.com/json/FlightXML2/Enroute?airport=KSMO&filter=''&howMany=3&offset=0"
    username="username"
    password="***"
    result="result">
</cfhttp>

<!--- Output the whole JSON response --->
<cfdump var="#toString( result.fileContent )#">
<br />

<!--- Output idents --->
<cfset flightsArray =  #deserializeJSON(result.filecontent).EnrouteResult.enroute# />
<cfloop from="1" to="#ArrayLen(flightsArray)#" index="i">
    <br />
    <cfoutput>
        ident: #flightsArray*.ident# // 
        orig: #flightsArray*.originCity# //
        estimated arrival time: #flightsArray*.estimatedarrivaltime#
    </cfoutput>
</cfloop>



<br />
<br />

<!--- FlightInfo Test  --->

<cfhttp
    method="get"
    url="https://flightxml.flightaware.com/json/FlightXML2/FlightInfo?ident=N501CP&howMany=2&offset=0"
    username="username"
    password="***"
    result="result">
</cfhttp>

<!--- Output the whole JSON response. --->
<cfdump var="#toString( result.fileContent )#">
<br />

<!--- Output idents. --->
<cfset flightsArray =  #deserializeJSON(result.filecontent).FlightInfoResult.flights# />
<cfloop from="1" to="#ArrayLen(flightsArray)#" index="i">
    <br />
    <cfoutput>
        ident: #flightsArray*.ident# //
        origin: #flightsArray*.origin# //
        destination: #flightsArray*.destination# //
        actual departure time: #flightsArray*.actualdeparturetime# //
        estimated arrival time: #flightsArray*.estimatedarrivaltime#
    </cfoutput>
</cfloop>

Let me know if the examples work for you. It does require some change in the way you request data and parse it, but this seems the best approach for you to start using FlightXML2.********

Thanks again for all your great help on this. Please tell your boss to give you a raise!

Rather than continue to fight with Cold Fusion, I’ve switched to a hybrid Cold Fusion / PHP solution which is working fine. PHP actually does the SOAP call to FlightAware and then returns a JSON file to Cold Fusion. Here’s the basic code…

Cold Fusion

...more code...

PHP

<?php header('Content-Type: application/json'); $options = array( 'login' => 'g...r', 'password' => '3a...2a' ); $flight = new SoapClient('http://flightxml.flightaware.com/soap/FlightXML2/wsdl', $options); $params = array("ident" => $_GET"ident"],"howMany"=>"15"); $result = $flight->FlightInfo($params); echo json_encode($result); ?>

It’s great that you have a working version with FlightXML2.
I just wanted to let you know that one of the CF developers just wrote this post
http://milanchandnacf.blogspot.in/2016/02/has-your-webservice-code-stopped.html

I tried that “stAuth.wsversion = 1;” to default to Axis1 and it works for me:


    stAuth = structNew();
    stAuth.username = "username";
    stAuth.password = "***";
    stAuth.wsversion = 1;
    ws = createObject("webservice", "https://flightxml.flightaware.com/soap/FlightXML2/wsdl", stAuth);

So this is another option for you if you want to use ColdFusion only.