The followings are my files please give some ideas

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>

RemoteServiceHandler

package 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

-- 
You received this message because you are subscribed to the Google Groups "Flex 
India Community" group.
To post to this group, send email to flex_in...@googlegroups.com.
To unsubscribe from this group, send email to 
flex_india+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/flex_india?hl=en.

Reply via email to