Search the web
Sign In
New User? Sign Up
cairngorm-devel · Cairngorm Developers
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Want your group to be featured on the Yahoo! Groups website? Add a group photo to Flickr.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
ServiceLocator issue in Flex 2.0.1/Hotfix 2 + Cairngorm 2.2   Message List  
Reply | Forward Message #182 of 210 |
I've got a problem with ServiceLocator, and that problem didn't
exist until my today's Flex & Cairngorm upgrade (to Hotfix 2 +
Cairngorm 2.2).

Context:
--------
In my <mx:ServiceLocator> I've got 3 web services defined, one of
which is a public one (the others are protected). "Public" means
it's not secured on the server and contains only "login(user, pass)"
method (and it has a known URL in the application start). After the
successfull login, the login method returns WSDL URLs of all other
web services.

Problem:
--------
The problem is that a service locator IMMEDIATE LOADS ALL WSDL-s of
it's (web service) children. But: this happens only when the
ServiceLocator is referenced FROM THE DELEGATE CLASS (using 'service
= ServiceLocator.getInstance().getWebService("publicWebService") as
WebService;'). When it is referenced from the main page, this
problem doesn't exist. Of course, these other web services doesn't
have proper WSDL-s assigned yet, so I got an error.

Note: I HAVE TO reference the web service from the delegates since I
have to invoke web service methods from that delegates.

Since I didn't quite understand what's going on here, please give me
some advice. Thanks!

Code:
-----

public class LoginDelegate
{
private var responder: IResponder;
private var service: WebService;

public function LoginDelegate(responder: IResponder)
{
service = ServiceLocator.getInstance
().getWebService"publicWebService") as WebService; // this is the
line which brings up error
this.responder = responder;
}

public function login(user:String, pass:String):void
{
var token:AsyncToken = service.Login(user, pass);
token.resultHandler = this.onResult;
token.faultHandler = this.onFault;
}

//-----------------------
protected function onResult(event:ResultEvent):void
{
responder.result(event);
}
protected function onFault(event:FaultEvent):void
{
responder.fault(event);
}
}

Error Detail:
-------------
TypeError: Error #1009: Cannot access a property or method of a null
object reference.
at business::Services/__mainWebService_fault()
at
flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchE
ventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.rpc::AbstractService/dispatchEvent()
at mx.rpc.soap.mxml::WebService/dispatchEvent()
at mx.rpc.soap::WebService/loadWSDL()
at com.adobe.cairngorm.business::WebServices/register()
at
com.adobe.cairngorm.business::ServiceLocator/get ::webServices()
at com.adobe.cairngorm.business::ServiceLocator/getWebService
()
at business::LoginDelegate$iinit()
at command::LoginCommand/execute()
at
com.adobe.cairngorm.control::FrontController/com.adobe.cairngorm.cont
rol:FrontController::executeCommand()
at
flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchE
ventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at
com.adobe.cairngorm.control::CairngormEventDispatcher/dispatchEvent()
at component.form::LoginForm/::login()
at component.form::LoginForm/::validateMe()
at component.form::LoginForm/__loginButton_click()





Thu Jul 26, 2007 10:47 am

danko_kozar
Offline Offline
Send Email Send Email

Forward
Message #182 of 210 |
Expand Messages Author Sort by Date

I've got a problem with ServiceLocator, and that problem didn't exist until my today's Flex & Cairngorm upgrade (to Hotfix 2 + Cairngorm 2.2). ... In my...
Danko Kozar
danko_kozar
Offline Send Email
Jul 26, 2007
10:49 am

Hi Danko, Are you sure its trying to load up the other WSDLs? service = ServiceLocator.getInstance ... has an error, as its missing a ( I have updated it below...
mark_j_ellul
Offline Send Email
Jul 26, 2007
11:30 am

No, this syntax error was made in cut&paste process. Well, the problem is - as soon as I reference my first web service from the delegate (and SURE, this web...
Danko Kozar
danko_kozar
Offline Send Email
Jul 26, 2007
3:20 pm

No, this syntax error was made in cut&paste process. Well, the problem is - as soon as I reference my first web service from the delegate (and SURE, this web...
Danko Kozar
danko_kozar
Offline Send Email
Jul 26, 2007
8:15 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help