So here's my situation: On the Flex side, I have received a result set
from the database, made changes to a few of its attributes, and
am trying to send it back to Java so that the changes can be saved to
the database. I looked at Hari's thread on the matter
(http://groups.yahoo.com/group/flexcoders/message/14164), but that
doesn't seem to be my problem, because I don't mind saving my data as
a generic Array (in Flex)/ArrayList (in Java).

The problem occurs when I try to send the Array back to Java... 

I assign it to an eventObject and broadcast the event:

var eventObject:Object = new Object();
eventObject.writtenDescription = writtenDescription; //
writtenDescription is a local variable that holds the result set
returned from the database on a prior remote object call
EventBroadcaster.getInstance().broadcastEvent(
RegistryController.EVENT_SAVE_WRITTEN_DESCRIPTION, eventObject );

I then pass the eventObject through a Command to the Delegate:

public function saveWrittenDescription() : Void {
var call =
service.saveWrittenDescription(event.data.writtenDescription);
call.resultHandler = Delegate.create( responder, responder.onResult );
call.faultHandler = Delegate.create( responder, responder.onFault );
}

The Java method waiting on the other end looks like this:

public void saveWrittenDescription(ArrayList writtenDescription)
throws Exception {
// code removed to conserve space
}

The error I see in the Network Monitor when trying to invoke the Java
method looks like this:

[object] : 
code[String] : Server.Processing
description[String] : Cannot invoke method 'saveWrittenDescription'.
details[String] : The expected argument types are
(java.util.ArrayList) but the supplied types were
(flashgateway.io.ASObject) and converted to (null).
level[String] : error
rootcause[object] : 
code[null] : null
description[String] : Type RecordSet not found
details[String] : 
level[String] : error
type[String] : 
type[String] : 

So, to attempt to fix what looked to be a type-cast error, I cast
writtenDescription to an Array, keeping all other code as it was before:

eventObject.writtenDescription = Array(writtenDescription);

That did not fix the problem, as the Network Monitor still showed:

[object] : 
code[String] : Server.Processing
description[String] : Cannot invoke method 'saveWrittenDescription'.
details[String] : The expected argument types are
(java.util.ArrayList) but the supplied types were
(java.util.ArrayList) and converted to (null).
level[String] : error
rootcause[object] : 
code[null] : null
description[String] : Type RecordSet not found
details[String] : 
level[String] : error
type[String] : 
type[String] : 

I don't understand why it is still breaking if the expected argument
equals the supplied argument. Can anyone provide some insight, please?

Thank you,
YJ








--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to