I am trying to do something that should be really simple. I
am trying use an MXML RemoteObject control to access a java class.
This class works fine with data services, so I am assuming I have a
configuration problem. It does not appear that a call to the java
class method is being made.
Here is my configuration for my flex-remoting-services.xml
<?xml version="1.0" encoding="UTF-8"?>
<service id="remoting-service"
class="flex.messaging.services.RemotingService"
messageTypes="flex.messaging.messages.RemotingMessage">
<adapters>
<adapter-definition id="java-object" class="flex.messaging.services.remoting.adapters.JavaAdapter" default="true"/>
</adapters>
<default-channels>
<channel ref="my-amf"/>
</default-channels>
<destination id="ContactAddressTypeRO" >
<properties>
<source>com.gcloans.dao.flex.ContactAddressTypeAssembler</source>
</properties>
</destination>
</service>
The class is in a jar file that is in the lib directory.
here is my application MXML file.
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Script>
<![CDATA[
import mx.rpc.events.*;
import mx.collections.*;
import mx.controls.*;
[Bindable]
public var contactAddressList:Object;
private function getDatabasesHandler(event:ResultEvent):void
{
contactAddressList=event.result;
}
private function faultHandler(event:FaultEvent):void
{
Alert.show(event.fault.faultstring + " : " + event.fault.message, "The Error: " + event.fault.faultCode);
}
]]>
</mx:Script>
<mx:RemoteObject id="ro" destination="ContactAddressTypeRO" fault="faultHandler(event);">
<mx:method name="find" result="getDatabasesHandler(event);" />
</mx:RemoteObject>
<mx:Button id="btnGet" label="Get" click="ro.find();" />
<mx:DataGrid id="dg" dataProvider="{contactAddressList}" editable="true" width="100%" height="800" y="30">
<mx:columns>
<mx:DataGridColumn dataField="contactAddressTypeId" headerText="ID" editable="false" />
<mx:DataGridColumn dataField="contactAddressType" editable="true" />
</mx:columns>
</mx:DataGrid>
</mx:Application>
Here is my configuration for my flex-remoting-services.xml
<?xml version="1.0" encoding="UTF-8"?>
<service id="remoting-service"
class="flex.messaging.services.RemotingService"
messageTypes="flex.messaging.messages.RemotingMessage">
<adapters>
<adapter-definition id="java-object" class="flex.messaging.services.remoting.adapters.JavaAdapter" default="true"/>
</adapters>
<default-channels>
<channel ref="my-amf"/>
</default-channels>
<destination id="ContactAddressTypeRO" >
<properties>
<source>com.gcloans.dao.flex.ContactAddressTypeAssembler</source>
</properties>
</destination>
</service>
The class is in a jar file that is in the lib directory.
here is my application MXML file.
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Script>
<![CDATA[
import mx.rpc.events.*;
import mx.collections.*;
import mx.controls.*;
[Bindable]
public var contactAddressList:Object;
private function getDatabasesHandler(event:ResultEvent):void
{
contactAddressList=event.result;
}
private function faultHandler(event:FaultEvent):void
{
Alert.show(event.fault.faultstring + " : " + event.fault.message, "The Error: " + event.fault.faultCode);
}
]]>
</mx:Script>
<mx:RemoteObject id="ro" destination="ContactAddressTypeRO" fault="faultHandler(event);">
<mx:method name="find" result="getDatabasesHandler(event);" />
</mx:RemoteObject>
<mx:Button id="btnGet" label="Get" click="ro.find();" />
<mx:DataGrid id="dg" dataProvider="{contactAddressList}" editable="true" width="100%" height="800" y="30">
<mx:columns>
<mx:DataGridColumn dataField="contactAddressTypeId" headerText="ID" editable="false" />
<mx:DataGridColumn dataField="contactAddressType" editable="true" />
</mx:columns>
</mx:DataGrid>
</mx:Application>