The problem is that the service call is asynchronous. You need to look for
the result in your command. When you instantiate your Delegate (from your
Command, I assume) you pass the Command instance to the constructor as the
responder. When the service call is completed, the Flex framework will call
your result or fault method in the command. That's where you need to look at
the result.

HTH

Todd

On 1/23/07, achegedus <[EMAIL PROTECTED]> wrote:

  I have a small login app that is calling a web service to determine if
the login is valid. The web service currently only returns a string.

Here is the code:

in Services.mxml
<mx:WebService id="Service"
wsdl="http://localhost/GSSData/service.asmx?WSDL";
showBusyCursor="true"
useProxy="false"
makeObjectsBindable="false">
</mx:WebService>

in LoginDelegate.as:

public function login (loginVO:LoginVO):void{
service.loadWSDL();

DebugWindow.debug("service.wsdl: " + service.wsdl.toString());
var token:AsyncToken = service.login(loginVO.username,
loginVO.password);
DebugWindow.debug("After login:" + token.result.toString());
token.addResponder(responder);
}

My problem is that I am seeing the web service get called and the
response is returned, but it doesn't seem like my app is taking the
response. When I try to view the response in my debug window i get an
error:

TypeError: Error #1009: Cannot access a property or method of a null
object reference.

as though the web service isn't returning a value. I'm totally at a
loss here, I'm trying to learn Cairngorm, but i'm really struggling.
I basically am trying to rework this sample app:


http://www.alex-uhlmann.de/flash/adobe/blog/cairngormlogin/CairngormLogin.html

to use a web service and I having little to no success. can anyone
see what I'm doing wrong?

Thanks,
A

Reply via email to