Question : BlazeDS Service Call Returns Null

This is frustrating to say the least.

I have a BlazeDS turnkey installation, with a blazeds project in eclipse and a new adobe air app in flash builder, thats configured to use the blazeds server.

I initially set up a simple remote object with a single function to get a user using a username and password arguments.

This process constantly gave me the following error...

[RPC Fault faultString="Send failed" faultCode="Client.Error.MessageSend" faultDetail="Channel.Connect.Failed error NetConnection.Call.Failed: HTTP: Failed: url: 'http://kyword.swf/samples/messagebroker/amf'"]

I tried everything, but I followed the steps as layed out exactly in

http://www.adobe.com/devnet/livecycle/articles/blazeds_gettingstarted_02.html

and employing other methods from

http://www.adobe.com/devnet/flex/videotraining/?sdid=FDSKY

when the first failed to work.

Then I had friend suggest that I try to use the Connect to Data/Service wizard inside flash builder.  So I opened the wizard, clicked BlazeDS, and without any complaints, all the destinations were displayed in a list including the object that I am trying to connect to.

So then I select my object and click ok, and it generates the 5 code filse and what have you, so then I generate a service call, and then call the function in my actionscript.

This proceeded to send null pointer errors again and again, so eventually I went into my java code on the blazeds server and I quite literally commented out all the code and initialised a basic object myself and by hand I manually wrote some text fields into the object and return it, eliminating any possibility of error, but again the Service Call Token was yet again null, I just can not get anything to come through the function, even when there isnt any possible way for it to error!

Debugging this crap is a nightmare!

Answer : BlazeDS Service Call Returns Null

Ok, you dont actually get a value when you assign the method result to the token, you have to actually add a result event handler to the callresponder and wait for the result to appear there, when you assign a method to a token its basically putting it in queue and will always appear to be null at first.

<s:CallResponder id="getUserResult" result="insert result handing code or function here"/>
Random Solutions  
 
programming4us programming4us