Wednesday, July 25, 2007

Remove auto-registered web services while you are working

One of the little annoyances I've run into while working with publishing web services in ColdFusion is that it can be tiresome to remove the auto-registered wsdl files as you test. Here is a little bit of code you can stick at the top of your test files to clear out that cache.


<cfinvoke
component="CFIDE.adminapi.administrator"
method="login"
returnVariable="administrator" >
<cfinvokeargument name="adminPassword" value="yourAdminPassword" />
<cfinvokeargument name="adminUserId" value="admin" />
</cfinvoke>
<cfinvoke
component="CFIDE.adminapi.extensions"
method="getWebServices"
returnVariable="extensions" >
<cfinvokeargument name="includeAutoRegistered" value="true" />
</cfinvoke>
<cfloop collection="#extensions#" item="webservice">
<cfinvoke
component="CFIDE.adminapi.extensions"
method="deleteWebService" >
<cfinvokeargument name="name" value="#webservice#" />
</cfinvoke>
</cfloop>

3 comments:

  1. The cool thing is that they made this a lot easier in CF8. You can now just add refreshwsdl to your cfinvoke call.

    ReplyDelete
  2. Nice. This will come in handy soon. Bookmarking for future reference.

    ReplyDelete
  3. Cool. That is handy, Raymond.

    ReplyDelete