Hi Ben,

I can't think of anything that's changed between 2.1 and 2.2 that would
cause this. I'm guessing that the web services your defining dynamically
aren't getting registered with the service locator, so its probably a
timing thing. Have you moved to Flex 2.0.1 at the same time, though I
don't know of any specific reason why that would change something.

Can you check if your web services have registered in the  _webServices
Dictionary stored inside ServiceLocator? That dictionary is created
through lazy instantiation on the first call to get webServices() on the
service locator, so ensure that that call never happens before you have
created your dynamic web services.

Thanks,

Alistair

-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of ben.clinkinbeard
Sent: 17 May 2007 19:07
To: [email protected]
Subject: [flexcoders] Re: Cairngorm 2.2 incompatible with AS-based
ServiceLocator?

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\proje
cts\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:\ClearCa
se_Storage\a391949_PsaBatchToolRefactor_view\BackOffice\Components\Sourc
e\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\Comp
onents\Source\PSA.BatchTool\com\fmr\projects\PsaBatchTool\commands\GetRe
centBatchesCommand.as:27]
        at
com.adobe.cairngorm.control::FrontController/com.adobe.cairngorm.control
:FrontController::executeCommand()[C:\dev\swat\projects\ac_emea\Cairngor
m\com\adobe\cairngorm\control\FrontController.as:212]
        at
flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEven
tFunction()
        at flash.events::EventDispatcher/dispatchEvent()
        at
com.adobe.cairngorm.control::CairngormEventDispatcher/dispatchEvent()[C:
\dev\swat\projects\ac_emea\Cairngorm\com\adobe\cairngorm\control\Cairngo
rmEventDispatcher.as:113]
        at
com.adobe.cairngorm.control::CairngormEvent/dispatch()[C:\dev\swat\proje
cts\ac_emea\Cairngorm\com\adobe\cairngorm\control\CairngormEvent.as:77]
        at
com.fmr.projects.PsaBatchTool.commands::ApplicationIsReadyCommand/execut
e()[D:\ClearCase_Storage\a391949_PsaBatchToolRefactor_view\BackOffice\Co
mponents\Source\PSA.BatchTool\com\fmr\projects\PsaBatchTool\commands\App
licationIsReadyCommand.as:16]
        at
com.adobe.cairngorm.control::FrontController/com.adobe.cairngorm.control
:FrontController::executeCommand()[C:\dev\swat\projects\ac_emea\Cairngor
m\com\adobe\cairngorm\control\FrontController.as:212]
        at
flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEven
tFunction()
        at flash.events::EventDispatcher/dispatchEvent()
        at
com.adobe.cairngorm.control::CairngormEventDispatcher/dispatchEvent()[C:
\dev\swat\projects\ac_emea\Cairngorm\com\adobe\cairngorm\control\Cairngo
rmEventDispatcher.as:113]
        at
com.adobe.cairngorm.control::CairngormEvent/dispatch()[C:\dev\swat\proje
cts\ac_emea\Cairngorm\com\adobe\cairngorm\control\CairngormEvent.as:77]
        at
com.fmr.projects.PsaBatchTool.commands::LoadAppConfigCommand/com.fmr.pro
jects.PsaBatchTool.commands:LoadAppConfigCommand::configFileLoaded()[D:\
ClearCase_Storage\a391949_PsaBatchToolRefactor_view\BackOffice\Component
s\Source\PSA.BatchTool\com\fmr\projects\PsaBatchTool\commands\LoadAppCon
figCommand.as:56]
        at
flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEven
tFunction()
        at flash.events::EventDispatcher/dispatchEvent()
        at flash.net::URLLoader/flash.net:URLLoader::onComplete()





--- In [email protected], "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: [email protected] [mailto:[EMAIL PROTECTED] 
> On Behalf Of ben.clinkinbeard
> Sent: 03 May 2007 13:36
> To: [email protected]
> 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
>




--
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