Doug's Resume
OO Lexicon
Chat with Doug!
Recent Entries
You may also be interested in...

heaters
hotels boeken in 7 sec
Engagement Rings
Online Dating Australia




SURF'S UP!
You:
Your Web Site:
<< May, 2008 >>
SMTWTFS
123
45678910
11121314151617
18192021222324
25262728293031
Search Blog

ColdFusion Jobs
Recent Comments
Re: The Perfect Alternative to Gas Powered Vehicles (by Thomas Messier at 5/09 12:47 PM)
Re: Promoting Family Unity: Lowering Your Utility Bills! (by Fernando Lopez at 5/07 10:12 PM)
Re: Why I Hate ORMs (a solicited rant) (by Richard at 5/06 10:56 AM)
Re: Why I Hate ORMs (a solicited rant) (by dougboude at 5/06 10:27 AM)
Re: Why I Hate ORMs (a solicited rant) (by Richard at 5/06 6:50 AM)
Re: Why I Hate ORMs (a solicited rant) (by Sean Corfield at 5/06 1:40 AM)
Re: Why I Hate ORMs (a solicited rant) (by Steve Bryant at 5/05 5:07 PM)
Re: Why I Hate ORMs (a solicited rant) (by dougboude at 5/05 4:36 PM)
Re: Why I Hate ORMs (a solicited rant) (by Mark Mandel at 5/05 3:52 PM)
Re: Why I Hate ORMs (a solicited rant) (by dougboude at 5/05 3:42 PM)
Categories
Archives
Photo Albums
Funnies (5)
Family (3)
RSS
Reciprocal Links

Powered by
BlogCFM v1.11

16 June 2006
Refreshing Cached ColdFusion Webservices Through the Back Door
When developing CF webservices on a server that you don't have admin access to, it can be very frustrating (until you figure out the root cause) when you are making changes to your service and yet when you call it, the change doesn't seem to show up. Well, this is because ColdFusion caches its definition of the webservice, so subsequent changes can only be seen if that cached version is purged first.

This can be done via the CF administrator, but since many of us don't have access to the administrator, I share with you another solution...a backdoor to refresh these cached services.

Deleting a cached service will totally remove it from the cache (it'll be re-cached next time somebody calls it), while refreshing it will delete and then call the webservice again to grab a fresh copy of it. If running this on a shared server, you will see EVERYBODY's cached web services. Deleting or refreshing all services will do no harm, so no need to be concerned about touching someone else's stuff.

The code below should be copied into a single cf template. It's self calling in a generic way (using cgi.script_name), so no need to modify it in any way.


********************** The Code ************************************************************
     <H2>Webservices in cache:</H2>
   
     <cfobject action="CREATE" type="JAVA" class="coldfusion.server.ServiceFactory" name="factory">
     <cfset xmlRpc = factory.getXMLRPCService()>
     <cfset webServices = xmlRpc.mappings>
   
     <cfparam name="url.del" default="false">
     <cfparam name="url.refresh" default="false">
     <cfoutput>
     <cfif url.del>
            <cfloop item="webService" collection="#webServices#">
                    <cfset xmlRpc.unregisterWebService(webService)>
            </cfloop>
            <cflocation url="#cgi.script_name#">
     </cfif>
     <cfif url.refresh>
            <cfloop item="webService" collection="#webServices#">
                    <cfset xmlRpc.refreshWebService(webService)>
            </cfloop>
            <cflocation url="#cgi.script_name#">
     </cfif>
   
     <cfloop item="webService" collection="#webServices#">
            - #webService#<BR>
        <cfflush>
     </cfloop>
    <BR>
     [<A HREF="#cgi.script_name#?del=1">KILL ALL</A>]
     <BR>
     [<A HREF="#cgi.script_name#?refresh=1">REFRESH ALL</A>]
     </cfoutput>
     <HR>
 



Posted by dougboude at 12:00 AM | PRINT THIS POST! |Link | 0 comments
Subscription Options

You are not logged in, so your subscription status for this entry is unknown. You can login or register here.

No comments found.

Name:   Required
Email:   Required your email address will not be publicly displayed.

Want to receive notifications when new comments are added? Login/Register for an account.

Time to take the Turing Test!!!

What letter comes one place(s) after the letter F?
Type your answer exactly two time(s) in the designated box.

Type in the answer to the question you see above:

Your comment:

Sorry, no HTML allowed!