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)