The title says it all, but I will detail.
IF
-you are on ColdFusion 8
-and using the CFFTP tag with action=”listdir”
-and the remote FTP folder is on a UNIX system
THEN
CFFTP will not list the files and folders having last modification date 29 February.

Why this happens?

Apparently, because of a bug in the FTP client used by ColdFusion. The FTP client is Apache Commons NET – FTPClient, and according to this article:

The Unix ftp server returns the date in the format “MMM d HH:mm”. No year info is supplied.
This caused problems, of course, since Feb 29 is not a valid day in the default year 1970.

When was this discovered?

According to this thread on Adobe Forum, it was first reported on 29 February 2008:

CFFTP from one Red Hat AS 4 server to another Red Hat AS 4 server is not retrieving files with modification dates of February 29 2008. The files simply don’t show up in the listing. They do show up in every other FTP and SFTP program I’ve tried, including command-line FTP from the system trying to CFFTP and from other systems on the network. It appears to only be affecting CFFTP TO a unix/linux system.

When was this bug fixed?

Today, 26 April 2012, the bug is still present. As one users points out:

It happened again in 2012!
On windows 2003 server with CF 8
Come on Adobe. Neglected this one for 4 years cost me 5 hours of work today.

One can argue that it is not a ColdFusion bug, it’s an Apache FTPClient bug. But when this bug is affecting the correct function of ColdFusion, then an action is necessary. Moreover, when behind ColdFusion is a company the size of Adobe, there’s really no excuse for not fixing it for more than 4 years.

Coldfusion: cfinvoke timeout

Written on 19 March 2012, 03:57pm

Tagged with: , ,

Consider the following scenario: you make a cfinvoke to a remote web service, that takes a long time to execute. In the same, you want to be in control of your script, and present a timeout error message. The natural thing to do in this case is to use cfsetting requestTimeout.
Or, you can use the cfinvoke’s timeout attribute, as in the example below.

I created a ColdFusion component, to be used a web service: sleeping.cfc. This component has only one method – sleepit – that simulates a long process. In our case, it sleeps for 5 seconds.
The client – call_sleeping.cfm – is using the cfinvoke tag to call the sleepit() method, but it will only wait for 2 seconds (timeout=2). The error received after 2 seconds will be:

Could not perform web service invocation “sleepit”.

The code below. (more…)

Refresh ColdFusion web services

Written on 16 March 2012, 03:44pm

Tagged with: , ,

ColdFusion caches the WSDL. In order to flush this cache, you have the following options:

  1. ColdFusion administrator
  2. Programatically:
    In ColdFusion 8, you have two options:

    1. Cfinvoke’s refreshWSDL attribute:
      <cfinvoke webservice="#wsdl#" method="method"
              returnvariable="rv" refreshWSDL="yes">
              <cfinvokeargument name="arg" value="1"/>
      </cfinvoke>
            
    2. Cfobject’s arguments structure
      <cfscript>
            wsargs = structnew();
            wsargs.refreshwsdl="yes";
            somevar = createobject("webservice",
      "http://[server]/[webserviceurl]",wsargs);
            ...
      </cfscript>

    In ColdFusion 7, however, you can use the following solution:

    <cfset wsAddress = "http://your.web/service/url.cfc?wsdl">
    <!--- CF7 --->
    <cfset createObject("java", "coldfusion.server.ServiceFactory").
    XmlRpcService.refreshWebService(wsAddress) /> 
    

Read more

  1. CF8 Hidden Gem: Refreshing Web Service WSDL and CF proxy/stub with new RefreshWSDL option
  2. CF8 Hidden Gem: New ArgStruct argument for createObject with web services
  3. Flushing a cached web service (see also first comment)
  4. Refreshing Cached ColdFusion Webservices Through the Back Door (ignore the Comic Sans typeface)