hi Amit the following are my code and config files
remoting-config xml
<?xml version="1.0" encoding="UTF-8"?>
<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-amf"/>
</default-channels>
-->
<channel-definition id="my-amf" class="mx.messaging.channels.AMFChannel">
<endpoint url="
http://localhost:8080/MyApplication/messagebroker/amf"
class="flex.messaging.endpoints.AMFEndpoint"/>
<properties>
<polling-enabled>false</polling-enabled>
</properties>
</channel-definition>
<destination id="CreatingRpc">
<properties>
<source>com.adobe.remoteobjects.RemoteServiceHandler</source>
</properties>
<adapter ref="java-object"/>
</destination>
</service>
MyApplication.mxml<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="
http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Script>
<![CDATA[
import mx.controls.Alert;
]]>
</mx:Script>
<mx:RemoteObject id="remObj"
destination="CreatingRpc"
result="Alert.show(event.result.toString());"
fault="Alert.show(event.fault.faultString);"
/>
<mx:Button id="remoteService" label="Remote Service" click="remObj.getResults('Sujit');"/>
</mx:Application>
RemoteServiceHandlerpackage com.adobe.remoteobjects;
import java.util.Date;
public class RemoteServiceHandler {
public static void main(String args[])
{
System.out.println("Example of RemoteServiceHandler");
}
public RemoteServiceHandler()
{
}
public String getResults(String name)
{
String result = null;
result = "Hi " + name + ", this is a service and the time now is : " + new Date();
return result;
}
}
Root Folder:C:\Program Files\Tomcat\webapps\MyApplication
Root URL:
http://localhost:8080/MyApplication/ContextRoot:/MyApplication