Hi Steven,

Thanks a lot for your reply. I recompiled the swf again &
in the Tomcat console I could see that the method on my class
was being called. So, thing that made this whole thing work
was,

Matt's advice to change the endpoint URI to
http://localhost:8080/flex/messagebroker/amf

&

recompilation of the swf after it.

However on the browser side I am seeing this error in a new window,

An ActionScript error has occurred,
TypeError: Error #1009: null has no properties.
      at SimpleRemoteObject/::getNameHandler()
      at SimpleRemoteObject/___Operation1_result()
      at flash.events::EventDispatcher/dispatchEvent()
      at
mx.rpc::AbstractOperation/http://www.adobe.com/2006/flex/mx/internal::dispatchRpcEvent()
      at
mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::resultHandler()
      at flash.events::EventDispatcher/dispatchEvent()
      at mx.rpc::Producer/acknowledge()
      at
::NetConnectionMessageResponder/NetConnectionChannel.as$36:NetConnectionMessageResponder::handleResult()
      at mx.messaging::MessageResponder/result()

Any clues ?

Thanks,
Aejaz

--- In flexcoders@yahoogroups.com, "Steven Toth" <[EMAIL PROTECTED]> wrote:
>
> Did you recompile the SWF after changing the endpoint URI? 
>
> --- In flexcoders@yahoogroups.com, "aejaz_98" <aejaz_98@> wrote:
> >
> > Hi Matt,
> >
> > Thanks for your reply. Yes, I am running the SWF using the URL
> >
> http://localhost:8080/flex/SimpleRemoteObject/SimpleRemoteObject.html
> >
> > I also changed the channel endpoint URI from
> > http://{server.name}:{server.port}/{context.root}/messagebroker/amf
> > to
> > http://localhost:8080/flex/messagebroker/amf
> > but I still get the same result i.e. Channel.Connect.Failed error.
> > NetConnection.Call.Failed error:HTTP:Failed .
> >
> > Please let me know what else could be missin/misconfigured.
> >
> > Thanks,
> > Aejaz
> >
> > --- In flexcoders@yahoogroups.com, "Matt Chotin" <mchotin@> wrote:
> > >
> > > Are you running the SWF from http://localhost:8080/flex/ in your
> > > browser?  Everything seems OK to me otherwise.  Try changing the
> my-am
> > > channel entry to http://localhost:8080/flex/messagebroker/amf,
> but you
> > > shouldn't have needed to do it.
> > >
> > > 
> > >
> > > Matt
> > >
> > > 
> > >
> > > ________________________________
> > >
> > > From: flexcoders@yahoogroups.com
> [mailto:[EMAIL PROTECTED] On
> > > Behalf Of aejaz_98
> > > Sent: Tuesday, April 25, 2006 10:47 PM
> > > To: flexcoders@yahoogroups.com
> > > Subject: [flexcoders] (Flex20b2) RemoteObject access problem
> > >
> > > 
> > >
> > > Hi,
> > >
> > > I have posted a couple of messages on calling a method on a Java
> object
> > > using <mx:RemoteObject> tag but so far I haven't been successful.
> With
> > > help from Peter & Suresh I did proceed a little bit further but I
> am
> > > still unable to successfully call the method on the server side
> object.
> > > Since I described the problem in bits & pieces before, I think
> that I
> > > may have missed some step(s) which I don't know about. Here is
> what I
> > > have done step by step. Please let me know if I am doing anything
> wrong
> > > or not doing something.
> > >
> > > Basically what I wanted to do was to verify the connectivity from
> the
> > > browser side to a simple Java class on the back end using
> RemoteObject
> > > tag before doing anything major. To do this I take a (String)
> name from
> > > a TextInput field which is sent to the getString() method of the
> class
> > > called Echo which appends "Welcome " to the incoming String &
> returns it
> > > back. This is displayed by the state 'TargetState'.
> > >
> > > 1. Here is the mxml file named SimpleRemoteObject.mxml. Please
> take a
> > > look at my ActionScript methods as I am new to ActionScript as
> well.
> > >
> > > <?xml version="1.0" encoding="utf-8"?>
> > > <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
> xmlns="*"
> > > layout="absolute">
> > > <mx:TraceTarget level="0" />
> > > <mx:Script>
> > >     <![CDATA[
> > >         import mx.rpc.events.*;
> > >         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");
> > >             Alert.show(event.fault.faultDetail, "Error");   
> > >         }
> > >     ]]>
> > > </mx:Script>
> > >     <mx:states>
> > >         <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:method 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>
> > >
> > > For this project I defined the Flex root folder at
> > > C:\tomcat-5.5.9\webapps\flex & flex server URL to
> > > http://localhost:8080/flex/.
> > >
> > > 2. Defined the destination EchoString in
> > > C:\tomcat-5.5.9\webapps\flex\WEB-INF\flex\flex-remoting-
> service.xml as
> > > follows,
> > >
> > >     <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="EchoString">
> > >         <properties>
> > >             <source>samples.SimpleRemoteObject.Echo</source>
> > >         </properties>
> > >     </destination>
> > > 
> > > 3. Saved the mxml file in Flex Builder which created
> > > C:\tomcat-5.5.9\webapps\flex\SimpleRemoteObject directory & put
> the
> > > HTML, SWFs & _javascript_ files in it.
> > >
> > > 4. Compiled the Java class called Echo.java & put Echo.class in
> > > C:\tomcat-5.5.9\webapps\flex\WEB-
> INF\classes\samples\SimpleRemoteObject.
> > >
> > > package samples.SimpleRemoteObject;
> > > public class Echo {
> > >     public Echo(){
> > >     }
> > >     public String getString(String str){
> > >         System.out.println("In Echo::getString(), got " + str);
> > >         return "Welcome " + str ;
> > >     }
> > > }
> > >
> > > 5. Started tomcat & went to,
> > >
> http://localhost:8080/flex/SimpleRemoteObject/SimpleRemoteObject.html
> > >
> > > 6. First page got painted fine, input a name & clicked on 'Submit'
> > >
> > > 7. I get Channel.Connect.Failed error. NetConnection.Call.Failed
> > > error:HTTP:Failed in the Alert box.
> > >
> > > C:\tomcat-5.5.9\webapps\flex\WEB-INF\flex\flex-enterprise-
> services.xml
> > > has,
> > >
> > >         <channel-definition id="my-amf"
> > > class="mx.messaging.channels.AMFChannel">
> > >             <endpoint
> > > uri="http://{server.name}:{server.port}/
> {context.root}/messagebroker/amf
> > > " class="flex.messaging.endpoints.AMFEndpoint"/>
> > >             <properties>
> > >                 <polling-enabled>false</polling-enabled>
> > >             </properties>
> > >         </channel-definition>
> > >
> > >
> > > Thanks,
> > > Aejaz
> > >
> > >
> > > --
> > > 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
> > > <http://groups.yahoo.com/group/flexcoders> " on the web.
> > >        
> > > *      To unsubscribe from this group, send an email to:
> > >       [EMAIL PROTECTED]
> > > <mailto:[EMAIL PROTECTED]
> subject=Unsubscribe>
> > >        
> > > *      Your use of Yahoo! Groups is subject to the Yahoo! Terms of
> > > Service <http://docs.yahoo.com/info/terms/> .
> > >
> > > 
> > >
> > > ________________________________
> > >
> >
>







--
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




Reply via email to