Refresh Coldfusion Web Service WSDL definition programmatically
Working on a project that requires two coldfusion servers to chat with each other through web services; something I haven't had to do for many years now. Anyway, as soon as I made a change to my publishing CFC, my consuming CFC started complaining. Seems that the server caches the WSDL signature of the remote cfc. That is great for production, but not so much for development. So, practically crawling into the wayback machine, I quickly found Brandon Purcell's nearly 6 year old solution to Refreshing Web Service Stubs in ColdFusion MX. With two moments worth of added abstraction:
<cffunction name="refreshRemoteService" access="public" output="false" returntype="boolean">
<cfargument name="service" type="string" required="true" />
<cfset _return = true />
<cftry>
<cfobject type="JAVA" action="Create" name="factory" class="coldfusion.server.ServiceFactory">
<cfset RpcService = factory.XmlRpcService>
<cfset RpcService.refreshWebService(arguments.service)>
<cfcatch type="any"><cfset _return = false></cfcatch>
</cftry>
<cfreturn _return />
</cffunction>
And here's a handy usage example:
<cfscript>
remoteWebPublisher = "http://www.remoteDomain.com/path/to/myRemote.cfc?wsdl";
refreshStatus = refreshRemoteService(remoteWebPublisher);
ws = Createobject("webservice",remoteWebPublisher);
myResult = ws.myRemoteMethod();
</cfscript>
Something worth remembering.


Access to Java objects in the ColdFusion package has been disabled by the administrator. "
One is with an update in CF7 (which does require an Admin password as it uses the Admin API), as discussed here:
http://carehart.org/blog/client/index.cfm/2006/12/...
The other is with a change in CF8, which does NOT require any admin or Java access but instead is a new RefreshWSDL attribute you can use when invoking the web service (but which has its own issues to think about), which I discuss here:
http://www.carehart.org/blog/client/index.cfm/2007...
Hope that's helpful. (I came across this while doing a search for something related to this and found the blog entry. Keep up the good work, Jason.)