I recently posted about the Coldbox 2.6 environment interceptor and how it allows you to set different config settings for your app. Then, I released a BugLogHQ plugin for Coldbox. After taking in some feedback, and chatting with Luis, I have made some modifications. This post will discuss the updated Webservice Plugin. I will post another to go over the updates to the BugLog plugin.
Currently the native Webservice support for Coldbox expects 2 WSDL URLs for each service, one for DEV and one for PROD.
Well, with the new environment specific settings, it defeats the purpose of defining them like this any longer. You can now set them in your environemnts.xml.
Luis plans to deprecate the current method, but not sure as to when. So implementing this can be done in a number of ways in the meantime.
First option: Overwrite existing Webservice plugin distributed with Coldbox and move your Webservice declarations out of the coldbox config file and into your environments.xml.
** You will not have to modify any application code **
Second Option: Place the updated version into your plugins folder, and call it by using getPlugin(‘webservices’,true). This is for those who need some time to update for the deprecation.
You can continue to use your existing Webservices from the coldbox config. Allowing you to add new ones to your environments.xml but remember to use the ‘,true’ when calling the webserivce plugin.
Honestly, I recommend the first option, as it shouldn’t take much effort to transfer Webservice WSDLs to the environments.xml, and you wont create a mesh of syntax with getPlugin() calls.