Hi All,
I did lot of testing and Still cannot figure out why the
ServiceLocator is unable to get the RemoteObjects..
When i try to create a new Object using new
RemoteObject("SERVICE_NAME") it works. How ever the same code returns
null from my Delegate !!!!!
My Services.mxml looks like
[CODE]
<service:ServiceLocator xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:service="com.universalmind.cairngorm.business.*" >
<mx:RemoteObject id="UserInformationFacade"
destination="UserInformationFacade">
</mx:RemoteObject>
</service:ServiceLocator>
[/CODE]
And my remoting-config.xml is as listed below:
[CODE]
<destination id="UserInformationFacade">
<properties>
<factory>spring</factory>
<source>userInformationFacade</source>
</properties>
</destination>
[/CODE]
My Application has the following code for initializing the Services..
<business:Services />
Here is the Code i have in my Delegate:
[CODE]
public function LoginDelegate(responder:IResponder)
{
super(responder);
trace("Here in LoginDelegate() and responder ="+responder);
// Initialize the Login Service..
if(service==null){
var serviceLocator:ServiceLocator =
com.universalmind.cairngorm.business.ServiceLocator.getInstance();
trace("Service Locator ="+serviceLocator+" && Service
Name ="+Services.LOGIN_SERVICE);
service =
serviceLocator.getRemoteObject(Services.LOGIN_SERVICE);
trace("Service from Service Locator ="+service);
if(service==null){
trace("Geting the Service using the RemoteObject
"+Services.LOGIN_SERVICE);
service =new RemoteObject(Services.LOGIN_SERVICE);
trace("Service ="+service);
}
}
trace(" service in LoginDelegate() ="+service);
}
[/CODE]
So here i am trying to get the RemoteObject first from the
ServiceLocator and if it returns null i am trying to create it
diretctly and it is giving null either way..
How ever when i try to create it from my view it returns the Remote
Object..
[CODE]
private function init():void {
//creating remote user information object
trace("Here in init() of Login.mxml");
userInformation= new RemoteObject("UserInformationFacade");
trace("UserInformation ="+UserInformation);
}
[/CODE]
in my flashlog.txt i have the trace log..
[LOG]
Here in Init()
Services =[object Services]
MyView =Login288
Here in init() of Login.mxml
UserInformation =[RemoteObject destination="UserInformationFacade"
channelSet="null"]
Here in checkCredentials()
Here in LoginCommand
Event Type =LoginEvent
Here in doLogIn and event =[Event type="LoginEvent" bubbles=true
cancelable=false eventPhase=2]
Here in LoginDelegate() and responder =[object Callbacks]
Service Locator =[object Services] && Service Name
=DPAUserInformationFacade
Service from Service Locator =null
Geting the Service using the RemoteObject UserInformationFacade
Service =null
service in LoginDelegate() =null
Here before making a call on the Delegate
Here in login and service =null && userId =[tuser2] & password =[password]
Unable to Find the Service and Service is NULL
LoginEvent Dispatched =true
[/LOG]
Thanks for your help
Regards
Mars