In my project I want to use a RemoteObject instance to
retrieve a Java object. I think I've got all the files in the right
places, but still I get this error:
[RPC Fault faultString="[MessagingError message='The
MessageAgent's destination must be set to send messages.']"
faultCode="InvokeFailed" faultDetail="Couldn't establish a
connection to ''"]
at mx.rpc::AbstractInvoker/
http://www.adobe.com/2006/flex/mx/internal::invoke() at mx.rpc.remoting.mxml::Operation/
http://www.adobe.com/2006/flex/mx/internal::invoke() at mx.rpc.remoting::Operation/send()
at Function/
http://adobe.com/AS3/2006/builtin::apply() at mx.rpc.remoting.mxml::Operation/send()
at Function/
http://adobe.com/AS3/2006/builtin::apply() at mx.rpc::AbstractService/
http://www.adobe.com/2006/actionscript/flash/proxy::callProperty() at Medewerkers/request()
at Medewerkers/___Application1_creationComplete()
at
flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
My RemoteObject code looks like this:
<mx:RemoteObject id="MedewerkerService"
source="com.atosorigin.services.MedewerkerService">
<mx:method name="getMedewerkers"
result="{resultHandler(event)}" />
</mx:RemoteObject>The return object is an array of Medewerker, which I retrieve
like this:
public function resultHandler(event:ResultEvent):void {
medewerkers = event.result as ArrayCollection;
}I use the following Services-config.xml:
<services-config>
<services>
<service-include file-path="remoting-config.xml" />
</services>
<channels>
<channel-definition id="my-graniteamf"
class="mx.messaging.channels.AMFChannel">
<endpoint uri="
http://{server.name}:{server.port}/{context.root}/graniteamf/amf"class="flex.messaging.endpoints.AMFEndpoint" />
</channel-definition>
</channels>
</services-config>
With a remoting-config.xml:
<service id="remoting-service"
class="flex.messaging.services.RemotingService">
<adapters>
<adapter-definition id="java-object"
class="flex.messaging.services.remoting.adapters.JavaAdapter"
default="true" />
</adapters>
<default-channels>
<channel ref="my-graniteamf" />
</default-channels>
<destination id="pojo">
<channels>
<channel ref="my-graniteamf" />
</channels>
<properties>
<scope>session</scope>
<source>com.atosorigin.services.MedewerkerServicce</source>
</properties>
</destination>
</service>
Thank you :)