[flexcoders] Re: Cairngorm 2.2 incompatible with AS-based ServiceLocator?
Hi Ali, Sorry its taken me so long to respond- had to finish up a project. Anyhow, I was able to solve the mystery pretty quickly once I revisited things this morning. I followed your advice and examined the output of describeType(), which led me to discover that the web services properties were made bindable in the MXML based ServiceLocator subclass, but not in the AS based one. This resulted in the web service properties being defined in variable nodes in describeType() rather than accessor nodes. Marking the properties [Bindable] in my AS-based class allows things to work properly, but I still have a couple of question marks about this. How/why do the services get marked bindable in the MXML-based ServiceLocator? What change in Caingorm 2.2 necessitates explicitly marking AS-based services as [Bindable]? Thanks for your help on this, Ben --- In flexcoders@yahoogroups.com, Alistair McLeod [EMAIL PROTECTED] wrote: Hi Ben, It does sound like something to do with describeType(), though I can't see Cairngorm 2.2 could have changed what it returns. Can you compare the describeType() output in the two versions. Have you debugged the application and stepped through the getWebService() call to see whats happening there? Ali -Original Message- From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of ben.clinkinbeard Sent: 18 May 2007 14:47 To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Cairngorm 2.2 incompatible with AS-based ServiceLocator? Hi Alistair, _webServices is empty, but we already knew that. Looking at ServiceLocator in the debugger shows all of my WebService objects properly constructed and present, they're just not registered for whatever reason. As far as I can tell, getWebService() does not get called before the first time I try to access one of my WS objects, which is when it bombs. I thought maybe it was because I had forgotten to remove my manual calls to loadWSDL(), but removing those didn't help either. I've been up to date on the Flex SDK for a while now. Like I said, this began as soon as I switched to 2.2 without changing anything else. The _webServices dictionary is populated by calling describeType() and then harvesting the accessors XMLList, correct? I am almost positive that is the problem. WS properties defined in AS don't seem to be included in accessors, resulting in them never getting registered. Let me know what you think. Ben PS - I've converted to an MXML ServiceLocator, so this issue isn't holding me up, I'm just trying to make Cairngorm as robust as possible. --- In flexcoders@yahoogroups.com, Alistair McLeod amcleod@ wrote: 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: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of ben.clinkinbeard Sent: 17 May 2007 19:07 To: flexcoders@yahoogroups.com 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
RE: [flexcoders] Re: Cairngorm 2.2 incompatible with AS-based ServiceLocator?
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: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of ben.clinkinbeard Sent: 17 May 2007 19:07 To: flexcoders@yahoogroups.com 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
[flexcoders] Re: Cairngorm 2.2 incompatible with AS-based ServiceLocator?
Hi Alistair, _webServices is empty, but we already knew that. Looking at ServiceLocator in the debugger shows all of my WebService objects properly constructed and present, they're just not registered for whatever reason. As far as I can tell, getWebService() does not get called before the first time I try to access one of my WS objects, which is when it bombs. I thought maybe it was because I had forgotten to remove my manual calls to loadWSDL(), but removing those didn't help either. I've been up to date on the Flex SDK for a while now. Like I said, this began as soon as I switched to 2.2 without changing anything else. The _webServices dictionary is populated by calling describeType() and then harvesting the accessors XMLList, correct? I am almost positive that is the problem. WS properties defined in AS don't seem to be included in accessors, resulting in them never getting registered. Let me know what you think. Ben PS - I've converted to an MXML ServiceLocator, so this issue isn't holding me up, I'm just trying to make Cairngorm as robust as possible. --- In flexcoders@yahoogroups.com, Alistair McLeod [EMAIL PROTECTED] wrote: 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: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of ben.clinkinbeard Sent: 17 May 2007 19:07 To: flexcoders@yahoogroups.com 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
RE: [flexcoders] Re: Cairngorm 2.2 incompatible with AS-based ServiceLocator?
Hi Ben, It does sound like something to do with describeType(), though I can't see Cairngorm 2.2 could have changed what it returns. Can you compare the describeType() output in the two versions. Have you debugged the application and stepped through the getWebService() call to see whats happening there? Ali -Original Message- From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of ben.clinkinbeard Sent: 18 May 2007 14:47 To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Cairngorm 2.2 incompatible with AS-based ServiceLocator? Hi Alistair, _webServices is empty, but we already knew that. Looking at ServiceLocator in the debugger shows all of my WebService objects properly constructed and present, they're just not registered for whatever reason. As far as I can tell, getWebService() does not get called before the first time I try to access one of my WS objects, which is when it bombs. I thought maybe it was because I had forgotten to remove my manual calls to loadWSDL(), but removing those didn't help either. I've been up to date on the Flex SDK for a while now. Like I said, this began as soon as I switched to 2.2 without changing anything else. The _webServices dictionary is populated by calling describeType() and then harvesting the accessors XMLList, correct? I am almost positive that is the problem. WS properties defined in AS don't seem to be included in accessors, resulting in them never getting registered. Let me know what you think. Ben PS - I've converted to an MXML ServiceLocator, so this issue isn't holding me up, I'm just trying to make Cairngorm as robust as possible. --- In flexcoders@yahoogroups.com, Alistair McLeod [EMAIL PROTECTED] wrote: 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: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of ben.clinkinbeard Sent: 17 May 2007 19:07 To: flexcoders@yahoogroups.com 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\pro je cts\ac_emea\Cairngorm\com\adobe\cairngorm\business\WebServices.as:83] at com.adobe.cairngorm.business::ServiceLocator/getWebService()[C:\dev\sw at \projects\ac_emea\Cairngorm\com\adobe\cairngorm\business\ServiceLocator. as:171] at com.fmr.projects.PsaBatchTool.business::BatchDelegate$iinit()[D:\Clear Ca se_Storage\a391949_PsaBatchToolRefactor_view\BackOffice\Components\Sou rc e\PSA.BatchTool\com\fmr\projects\PsaBatchTool\business\BatchDelegate.as: 27] at com.fmr.projects.PsaBatchTool.commands::GetRecentBatchesCommand/execut e( )[D:\ClearCase_Storage\a391949_PsaBatchToolRefactor_view\BackOffice\Co mp onents\Source\PSA.BatchTool\com\fmr\projects\PsaBatchTool\commands\Get Re centBatchesCommand.as:27] at com.adobe.cairngorm.control
[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\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