4 Replies Latest reply on Oct 12, 2009 8:08 AM by GArlington

    Multiple web services on single server causing object undefined errors

    MSO Simon



      I've currently got a bit of a strange problem within a web service that is proving difficult to debug.


      There are the web service urls :

           api.domain.com                -> /var/www/html/api.domain.com/            -> CF mapping to MYSERVICE

           testapi.domain.com          -> /var/www/html/testapi.domain.com/     -> CF mapping to MYSERVICE_test


      In both instances the cfcs that contain the code to be translated into a WSDL reside in /api/..., in the case of this example, /api/common.cfc.  wsargs constists simply of refreshwsdl true.


      If I call the following 2 lines ...

           obj_myservice = CreateObject('webservice','http://api.domain.com/api/common.cfc?wsdl',wsargs);

           obj_myservice_test = CreateObject('webservice','http://testapi.domain.com/api/common.cfc?wsdl',wsargs);


      I then call the same method in both, and they are successful.  When checking the "Data & Services" -> "Web Services" panel within the CF control panel, only the web service "http://api.domain.com/api/common.cfc?wsdl" is listed, and not testapi.domain.com......


      If I reverse the order in which the WSDL's are loaded then this switches, and testapi.domain.com..... gets listed under "Web Services" but api.domain.com..... does not.  In essence it appears as though for some reason the CF server overwrites one with the other.  The exact "object undefined" error is proving difficult to reproduce reliably.


      This appears to happen no matter which server is accessing the web service, be it the same server or a remote server.  All servers involved are running CF8.  Accessing the 2 WSDL files in a browser results in the 2 WSDLs being rendered correctly with different namespace values.


      On the same server are 2 more services




      These reside in the /api2 directories on the same 2 subdomains, api. and testapi.   MYSERVICE2 and MYSERVICE2_test appear to conflict with each other.  MYSERVICE and MYSERVICE_test appear to conflict with each other.  MYSERVICE and MYSERVICE2 do not appear to conflict with each other.


      Is there a configuration change or anything like that which I should be aware of that would prevent me doing the above?  The 2 /api/ directories are nearly identical with the exception that the namespace and complex type names have been set to http://api.domain.com & MYSERVICE in the first, and http://testapi.domain.com & MYSERVICE_test in the second url.


      I have also tried mapping /MYSERVICE and /MYSERVICE_test within /opt/coldfusion8/WEB-INF/jrun-web.xml to no avail.


      Any help would be appreciated.  If there is any useful information that I have missed off please let me know and I'll dig it out.


      - Simon H