I declared my ServiceLocator subclass in AS rather than MXML, and when
my app loads I load an XML file. That XML file contains the WSDL URLs
for all the WebServices that I use in my app, so once it is loaded I
call an initServices() method that I defined on the ServiceLocator
subclass. The initServices() method declares my WebService objects,
sets up event listeners and calls loadWSDL() for each, using the URLs
defined in the loaded XML. Once all my loadWSDL() calls have returned
the app continues on to other startup tasks.

This all worked perfectly in Cairngorm 2.1. With 2.2 however, as soon
as I call ServiceLocator.getInstance().getWebService(), I get the
error and callstack pasted below. Debugging shows that all of my
WebService variables are defined and in memory, but for some reason
they are not registered with the ServiceLocator. In some quick tests,
I noticed that the describeType() call in AbstractServices.as does not
seem to include references to variables defined in AS. Since the
accessors list from describeType() seems to be the source of what gets
registered with ServiceLocator, my guess is that that is the source of
the problem.

You can see a slightly obfuscated version of the class at
http://returnundefined.com/files/MyAppServices.as

Thanks,
Ben

Error: C0009E: WebService not found for documentMetadataWebService
        at
com.adobe.cairngorm.business::WebServices/getService()[C:\dev\swat\projects\ac_emea\Cairngorm\com\adobe\cairngorm\business\WebServices.as:83]
        at
com.adobe.cairngorm.business::ServiceLocator/getWebService()[C:\dev\swat\projects\ac_emea\Cairngorm\com\adobe\cairngorm\business\ServiceLocator.as:171]
        at
com.fmr.projects.PsaBatchTool.business::BatchDelegate$iinit()[D:\ClearCase_Storage\a391949_PsaBatchToolRefactor_view\BackOffice\Components\Source\PSA.BatchTool\com\fmr\projects\PsaBatchTool\business\BatchDelegate.as:27]
        at
com.fmr.projects.PsaBatchTool.commands::GetRecentBatchesCommand/execute()[D:\ClearCase_Storage\a391949_PsaBatchToolRefactor_view\BackOffice\Components\Source\PSA.BatchTool\com\fmr\projects\PsaBatchTool\commands\GetRecentBatchesCommand.as:27]
        at
com.adobe.cairngorm.control::FrontController/com.adobe.cairngorm.control:FrontController::executeCommand()[C:\dev\swat\projects\ac_emea\Cairngorm\com\adobe\cairngorm\control\FrontController.as:212]
        at
flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
        at flash.events::EventDispatcher/dispatchEvent()
        at
com.adobe.cairngorm.control::CairngormEventDispatcher/dispatchEvent()[C:\dev\swat\projects\ac_emea\Cairngorm\com\adobe\cairngorm\control\CairngormEventDispatcher.as:113]
        at
com.adobe.cairngorm.control::CairngormEvent/dispatch()[C:\dev\swat\projects\ac_emea\Cairngorm\com\adobe\cairngorm\control\CairngormEvent.as:77]
        at
com.fmr.projects.PsaBatchTool.commands::ApplicationIsReadyCommand/execute()[D:\ClearCase_Storage\a391949_PsaBatchToolRefactor_view\BackOffice\Components\Source\PSA.BatchTool\com\fmr\projects\PsaBatchTool\commands\ApplicationIsReadyCommand.as:16]
        at
com.adobe.cairngorm.control::FrontController/com.adobe.cairngorm.control:FrontController::executeCommand()[C:\dev\swat\projects\ac_emea\Cairngorm\com\adobe\cairngorm\control\FrontController.as:212]
        at
flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
        at flash.events::EventDispatcher/dispatchEvent()
        at
com.adobe.cairngorm.control::CairngormEventDispatcher/dispatchEvent()[C:\dev\swat\projects\ac_emea\Cairngorm\com\adobe\cairngorm\control\CairngormEventDispatcher.as:113]
        at
com.adobe.cairngorm.control::CairngormEvent/dispatch()[C:\dev\swat\projects\ac_emea\Cairngorm\com\adobe\cairngorm\control\CairngormEvent.as:77]
        at
com.fmr.projects.PsaBatchTool.commands::LoadAppConfigCommand/com.fmr.projects.PsaBatchTool.commands:LoadAppConfigCommand::configFileLoaded()[D:\ClearCase_Storage\a391949_PsaBatchToolRefactor_view\BackOffice\Components\Source\PSA.BatchTool\com\fmr\projects\PsaBatchTool\commands\LoadAppConfigCommand.as:56]
        at
flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
        at flash.events::EventDispatcher/dispatchEvent()
        at flash.net::URLLoader/flash.net:URLLoader::onComplete()





--- In flexcoders@yahoogroups.com, "Alistair McLeod" <[EMAIL PROTECTED]> wrote:
>
> Hi Ben,
> 
> I'm not exactly sure whats going on here. Can you give more info, with
> code and the exception your seeing?
> 
> Thanks,
> 
> Alistair 
> 
> -----Original Message-----
> From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
> Behalf Of ben.clinkinbeard
> Sent: 03 May 2007 13:36
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] Cairngorm 2.2 incompatible with AS-based
> ServiceLocator?
> 
> I think there may be a problem related to using the accessors collection
> returned by describeType() in AbstractServices.as. It doesn't seem to
> include items declared in AS.
> 
> I am getting an error saying the web service can't be found or something
> similar when calling getWebService() on my AS-based ServiceLocator. When
> my app starts up it loads a config file that contains the WSDL urls for
> the services in my app. Once the file has loaded, I call an
> initServices() function on my SL where I define the WebService
> properties. When I subsequently try to call getWebService(), it bombs
> saying it doesn't exist.
> 
> Looking at the callstack shows that all of my services are properly
> created, they just don't seem to get registered with SL.
> 
> Ideas? Bug?
> 
> Thanks,
> Ben
> 
> PS - I posted to the cairngorm-devel list almost 24 hours ago and it
> still hasn't shown up, so sorry if it eventually does.
> 
> 
> 
> --
> Flexcoders Mailing List
> FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> Search Archives:
> http://www.mail-archive.com/flexcoders%40yahoogroups.com
> Yahoo! Groups Links
>


Reply via email to