ApplicationServiceSoap is my code - it is the class I quoted a few
posts earlier.  In this case, it is not the first time the class is
running, but it is the first time the function is running.

It is long (256 lines), but here are what I think are the relevant parts:
package com.pinnacol.sane.service {
    import com.pinnacol.sane.dataobject.Application;
    
    import mx.collections.ArrayCollection;
    import mx.rpc.events.FaultEvent;
    import mx.rpc.events.ResultEvent;
    import mx.rpc.soap.mxml.WebService;
    public class ApplicationServiceSoap implements ApplicationService {
        private var webService:WebService;
        private var loadAllCallback:Function;
        private var loadApplicationCallback:Function;
        private var saveApplicationCallback:Function;
        private var deleteApplicationCallback:Function;

        /**
         * Called by another class before this class is used
         */
        public function setWebService(webService:WebService):void {
            this.webService = webService;
            webService.addEventListener(FaultEvent.FAULT,
ServiceFactory.faultHandler);
           
webService.loadAllApplications.addEventListener(ResultEvent.RESULT,
loadAllXmlHandler);
            webService.loadAllApplications.resultFormat= "e4x";
           
webService.loadApplication.addEventListener(ResultEvent.RESULT,
loadApplicationXmlHandler);
            webService.loadApplication.resultFormat = "e4x";
           
webService.saveSplitApplication.addEventListener(ResultEvent.RESULT,
saveXmlHandler);
            webService.saveSplitApplication.resultFormat="e4x";
           
webService.deleteApplication.addEventListener(ResultEvent.RESULT,
deleteHandler);
            webService.deleteApplication.resultFormat="e4x";
        }
        /**
         * Use the WebService to delete an application.  The 
         * deleteHandler should be called when the WebService
         * is finished.
         */
        public function deleteApplication(application:Application,
                                          user:String):void {
            if ( deleteApplicationCallback == null ) {
                throw new Error("No deleteAllCallback");
            }
            application.setEvents(null);
            application.setFunctions(null);
            webService.deleteApplication(application, user);
        }
        /**
         * Called when the WebService returns, use the callback
         * function (set by the original requestor) to let the
         * requestor know we are finished.
         */
        public function deleteHandler(event:ResultEvent):void {
            deleteApplicationCallback();
        }
    }
}

If some of the code looks a little convoluted, with all the callbacks,
it is because I am trying to separate my application into layers.  I
have MXML files that represent the view of my application,
ActionScript Model classes to represent the model behind the views,
ActionScript Service classes that represent the service layer -
handling all of my server communication and data access, and a Service
Factory - responsible for loading my service and returning it to the
Model layer.  This architecture allows me to create Service Mocks to
keep development moving when the Web Services aren't available, or
when the ActionScript service layer isn't working, as in this case.

Thank you so much for all of your help on this.

Steve


--- In flexcoders@yahoogroups.com, "Alex Harui" <[EMAIL PROTECTED]> wrote:
>
> The verifier runs on a class or function just before it runs it for the
> first time.
> 
>  
> 
> Is ApplicationServiceSoap your code?  Or is it coming from a
> library/swc?  What does the code for that look like?
> 


Reply via email to