Learn About Doug!
View Doug Boude's online resume
updated 11/18/2009

View Doug Boude's profile on LinkedIn
Link to me!

Follow Doug Boude on Twitter
Follow me!

Be Doug's friend on Facebook
Befriend me!
(I promise not to follow you home)
Contact Doug!
Help a Brutha Out!
help a brutha out!
OO Lexicon
Chat with Doug!
Recent Entries
You may also be interested in...
Florida web site design



Czech your Page Rank!
Check Page Rank of any web site pages instantly:
This free page rank checking tool is powered by Page Rank Checker service
Surf's Up!
Visit Egosurf.org and massage YOUR web ego!
My Score: 9,001
Doug's Books

Read (and recommend)

  • Men are from Mars, Women are from Venus
  • The Wisdom of Crowds: Why the Many Are Smarter Than the Few and How Collective Wisdom Shapes Business, Economies, Societies and Nations
  • Blink: The Power of Thinking Without Thinking
  • Head First Design Patterns
  • Transact-SQL Programming
  • What's So Amazing About Grace?
  • Just So Stories (Rudyard Kipling collection)

Reading

  • Prayer: Does it Make Any Difference?
  • Data Mining (Practical Machine Learning Tools and Techniques)
<< February, 2010 >>
SMTWTFS
123456
78910111213
14151617181920
21222324252627
28
Search Blog

Recent Comments
Categories
Archives
Photo Albums
Funnies (5)
Family (3)
RSS

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 | 1 comment
Subscription Options

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

Re: Refreshing Cached ColdFusion Webservices Through the Back Door
Thanks for the info...didn't realize they needed to be refreshed. Man, talk about hitting my head against a wall trying to figure out why my changes wouldn't fix the errors. Great info for those of us on shared servers (which i think is A LOT).

-Michael
Posted by Michael on December 19, 2008 at 12:36 PM

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!!!

12 plus 0 equals
Type in the answer to the question you see above:

Your comment:

Sorry, no HTML allowed!