Wednesday, October 22, 2008

Coldfusion API WSDL case sensitivity issue

ColdFusion automatically generates the WSDL file from the CFC. Now when a change is made to a CFC or the CF service is restarted, the wsdl file has to be re-generated. The wsdl file is generated when the first call to the CFC is made. Now if the first call that is made is made like /abc.cfc?wsdl, then the wsdl has <wsdl:portType name="abc"> ; but if the first call is made like /ABC.cfc?wsdl, then the wsdl has <wsdl:portType name="ABC">

This causes problems with clients that access the API - resulting in errors for them.

To resolve this issue, we developed an application in C#.Net that would basically call the wsdl file, check for the case of the portName. If portNmae is not same case as what is expected, then the app would restart the CF service, and then call the wsdl with the right case so that CF generates the right case portName in the WSDL.

Its a console app. and and it can be scheduled to run every so often.