Are you precompiling the SWFs? If so, are you specifying
--services and pointing to the configuration file at compile time with either
Flex Builder compiler command line arguments or mxmlc command line
arguments?
From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of aejaz_98
Sent: Monday, April 24, 2006 10:15 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] (Flex20 Beta2): RemoteObject Destination configuration problem
I have created a very simple 2 state mxml file(attached below) where you submit a name which is passed to a RemoteObject which appends "Welcome "
to the input string & returns the whole string back.
The java class which does this is,
package samples.SimpleRemoteObject;
public class Echo {
public Echo(){
}
public String getString(String str){
return "Welcome " + str ;
}
}
I have added the following to flex-remoting-service.xml under
c:\tomcat\webapps\flex\WEB-INF\flex,
<destination id="EchoString">
<properties>
<source>samples.SimpleRemoteObject.Echo</source>
</properties>
</destination>
The <default-channels> & <adapters> definition was already there.
I also put Echo.class under C:\tomcat\webapps\flex\WEB-INF\classes\samples\SimpleRemoteObject.
After Tomcat(v5.5.9) is started, it correctly loads the initial page
at http://localhost:8080/flex/SimpleRemoteObject/SimpleRemoteObject.html
but after I click on submit, I always get "Error: Unknown destination 'EchoString'". I have tried renaming the destination names but there is no change in behavior.
Please let me know what am I doing wrong. All the samples are running fine
though. This is my first attempt on doing something with Flex.
Thanks,
Aejaz
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*" layout="absolute">
<mx:Script>
<![CDATA[
&! nbsp; import mx.rpc.events.*;
&nbs! p; import mx.collections.*;
import mx.controls.*
private function getNameHandler(event:ResultEvent):void
{
Result.text = event.result.toString();
currentState='TargetState';
}
private function faultHandler(event:FaultEvent):void
{
Alert.show(event.fault.faultstring, "Error");
}
]]>
</mx:Script>
<mx:states>
&n! bsp; <mx:State name="TargetState">
<mx:RemoveChild child="{button1}"/>
<mx:RemoveChild child="{formInput}"/>
<mx:RemoveChild child="{label1}"/>
<mx:AddChild position="lastChild">
<mx:Label x="99" y="130" width="265" height="28" id="Result"/>
</mx:AddChild>
</mx:State>
</mx:states>
<mx:RemoteObject id="SendStringBack" destination="EchoString" showBusyCursor="true" fault="faultHandler(event)">
<mx:metho! d name="getString" result="getNameHandler(event)">
! ; <mx:arguments>
<str>
{formInput.text}
</str>
</mx:arguments>
</mx:method>
</mx:RemoteObject>
<mx:TextInput x="119" y="129" id="formInput"/>
<mx:Button x="119" y="170" label="Submit" fontSize="13" id="button1" click="SendStringBack.getString.send()"/>
<mx:Label x="119" y="86" text="What is your name ?" width="160" fontSize="15" id="label1"/>
</mx:Application>
--
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
- Visit your group "flexcoders" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.