Basic Remoting Problem
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > Macromedia Flash Server > Basic Remoting Problem




Pages (2): [1] 2 »   Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Basic Remoting Problem  
Merrill, Jason


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
06-27-05 10:45 PM

Hi all - first time here.  Not a lot of luck on Flashcoders (but thanks
to those who tried if they are on this list), so I thought I would try
this list.  I'm a Remoting virgin, (but not Actionscript) and I'm trying
to follow the HelloWorld application example in the LiveDocs, but am not
getting something right.  My ColdFusion experience is minimal - I have
completed the Figleaf course and that's it. =20

So, the setup:  I have a dynamic text field on the stage with an
instance name of "messageDisplay". The problem is the only thing I see
is in my trace
window:

6/24 17:56:37 [INFO] : Invoking helloWorld on remoteservices

And that's it. =20

The Code:

My ColdFusion component file is "HelloWorld.cfc" and only contains the
following:

<cfcomponent>
=09<cffunction name=3D"helloWorld" access=3D"remote">
=09	<cfreturn "Hello World">
=09</cffunction>
</cfcomponent>

I have tested this and other cfc and cfm files in the same location and
confirm they work in a browser.  The URL on my local machine is:

http://localhost/com/macromedia/test/HelloWorld.cfc

I have installed the 2.0 remoting classes and components and have no
problems importing them.  My Actionscript is in a file in the same
location as HelloWorld.cfc and is as follows:

import mx.remoting.Service;=20
import mx.services.Log;=20
import mx.rpc.RelayResponder;=20
import mx.rpc.FaultEvent;=20
import mx.rpc.ResultEvent;=20
import mx.remoting.PendingCall;=20
import mx.remoting.RecordSet;

// connect to service and create service object
var howdyService:Service =3D new
Service("http://localhost/com/macromedia/test/HelloWorld.cfc",
=09
new Log(),
=09
"remoteservices",
=09
null,=20
=09
null );

// call the service helloWorld() method
var pc:PendingCall =3D howdyService.helloWorld();

// tell the service what methods handle result and fault conditions
pc.responder =3D new RelayResponder( this, "helloWorld_Result",
"fault_Fault" ); =20

function helloWorld_Result(result:ResultEvent){
=09// display successful result
=09messageDisplay.text =3D flash.result;
=20          trace("helloWorld_Result called");
}
=09  =20
function fault_Fault(fault:FaultEvent){
=09//display fault returned from service
=09messageDisplay.text =3D fault.fault.faultstring;
}

Where have I erred?  Thanks for any insight.

Jason Merrill   |   E-Learning Solutions   |  icfconsulting.com











NOTICE:
This message is for the designated recipient only and may contain privile=
ged or confidential information. If you have received it in error, please=
=20notify the sender immediately and delete the original. Any other use o=
f this e-mail by you is prohibited.

=-----------------------------------------------------------
Supported by Fig Leaf Software - http://www.figleaf.com
=-----------------------------------------------------------

To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm






[ Post a follow-up to this message ]



    Re: Basic Remoting Problem  
JesterXL


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
06-27-05 10:45 PM

Add this up top:

NetDebug.initialize();

Then, open up your NetConnection Debugger, and tell us what it prints out.

----- Original Message -----
From: "Merrill, Jason" <JMerrill-xFcBdHuE1Uog9ELcbhaJlAC/G2K4zDHf@public.gma
ne.org>
To: <flashcomm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org>
Sent: Monday, June 27, 2005 3:10 PM
Subject: [FlashComm] Basic Remoting Problem


Hi all - first time here.  Not a lot of luck on Flashcoders (but thanks
to those who tried if they are on this list), so I thought I would try
this list.  I'm a Remoting virgin, (but not Actionscript) and I'm trying
to follow the HelloWorld application example in the LiveDocs, but am not
getting something right.  My ColdFusion experience is minimal - I have
completed the Figleaf course and that's it.

So, the setup:  I have a dynamic text field on the stage with an
instance name of "messageDisplay". The problem is the only thing I see
is in my trace
window:

6/24 17:56:37 [INFO] : Invoking helloWorld on remoteservices

And that's it.

The Code:

My ColdFusion component file is "HelloWorld.cfc" and only contains the
following:

<cfcomponent>
<cffunction name="helloWorld" access="remote">
<cfreturn "Hello World">
</cffunction>
</cfcomponent>

I have tested this and other cfc and cfm files in the same location and
confirm they work in a browser.  The URL on my local machine is:

http://localhost/com/macromedia/test/HelloWorld.cfc

I have installed the 2.0 remoting classes and components and have no
problems importing them.  My Actionscript is in a file in the same
location as HelloWorld.cfc and is as follows:

import mx.remoting.Service;
import mx.services.Log;
import mx.rpc.RelayResponder;
import mx.rpc.FaultEvent;
import mx.rpc.ResultEvent;
import mx.remoting.PendingCall;
import mx.remoting.RecordSet;

// connect to service and create service object
var howdyService:Service = new
Service("http://localhost/com/macromedia/test/HelloWorld.cfc",

new Log(),

"remoteservices",

null,

null );

// call the service helloWorld() method
var pc:PendingCall = howdyService.helloWorld();

// tell the service what methods handle result and fault conditions
pc.responder = new RelayResponder( this, "helloWorld_Result",
"fault_Fault" );

function helloWorld_Result(result:ResultEvent){
// display successful result
messageDisplay.text = flash.result;
trace("helloWorld_Result called");
}

function fault_Fault(fault:FaultEvent){
//display fault returned from service
messageDisplay.text = fault.fault.faultstring;
}

Where have I erred?  Thanks for any insight.

Jason Merrill   |   E-Learning Solutions   |  icfconsulting.com











NOTICE:
This message is for the designated recipient only and may contain privileged
or confidential information. If you have received it in error, please notify
the sender immediately and delete the original. Any other use of this e-mail
by you is prohibited.

Supported by Fig Leaf Software - http://www.figleaf.com

To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm



=-----------------------------------------------------------
Supported by Fig Leaf Software - http://www.figleaf.com
=-----------------------------------------------------------

To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm






[ Post a follow-up to this message ]



    RE: Basic Remoting Problem  
Merrill, Jason


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
06-27-05 10:45 PM

Thanks=20

Ok - I feel stupid for asking, but where/how do I open my NetConnection
Debugger?

Jason Merrill   |   E-Learning Solutions   |  icfconsulting.com









[vbcol=seagreen] 
out.[vbcol=seagreen] 
thanks[vbcol=seagreen] 
trying[vbcol=seagreen] 
not[vbcol=seagreen] 
and[vbcol=seagreen] 
privileged[vbcol=seagreen] 
notify[vbcol=seagreen] 
e-mail[vbcol=seagreen] 

=-----------------------------------------------------------
Supported by Fig Leaf Software - http://www.figleaf.com
=-----------------------------------------------------------

To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm






[ Post a follow-up to this message ]



    Re: Basic Remoting Problem  
JesterXL


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
06-27-05 10:45 PM

A FLA must be open to do this.

Window > Other Panels > NetConnection Debugger

----- Original Message -----
From: "Merrill, Jason" <JMerrill-xFcBdHuE1Uog9ELcbhaJlAC/G2K4zDHf@public.gma
ne.org>
To: "FlashComm Mailing List" <flashcomm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@pub
lic.gmane.org>
Sent: Monday, June 27, 2005 3:16 PM
Subject: RE: [FlashComm] Basic Remoting Problem


Thanks

Ok - I feel stupid for asking, but where/how do I open my NetConnection
Debugger?

Jason Merrill   |   E-Learning Solutions   |  icfconsulting.com









[vbcol=seagreen] 
out.[vbcol=seagreen] 
thanks[vbcol=seagreen] 
trying[vbcol=seagreen] 
not[vbcol=seagreen] 
and[vbcol=seagreen] 
privileged[vbcol=seagreen] 
notify[vbcol=seagreen] 
e-mail[vbcol=seagreen] 

Supported by Fig Leaf Software - http://www.figleaf.com

To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm


=-----------------------------------------------------------
Supported by Fig Leaf Software - http://www.figleaf.com
=-----------------------------------------------------------

To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm






[ Post a follow-up to this message ]



    RE: Basic Remoting Problem  
Merrill, Jason


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
06-27-05 10:45 PM

Thanks  - I never knew that panel existed. So I added
NetDebug.initialize(); right after my import statements, opened the
panel, and then tested the file in the IDE, but the panel didn't contain
any data. =20

Jason Merrill   |   E-Learning Solutions   |  icfconsulting.com









[vbcol=seagreen] 
NetConnection[vbcol=seagreen] 
prints[vbcol=seagreen] 
try[vbcol=seagreen] 
have[vbcol=seagreen] 
see[vbcol=seagreen] 
the[vbcol=seagreen] 
please[vbcol=seagreen] 
this[vbcol=seagreen] 

=-----------------------------------------------------------
Supported by Fig Leaf Software - http://www.figleaf.com
=-----------------------------------------------------------

To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm






[ Post a follow-up to this message ]



    Re: Basic Remoting Problem  
JesterXL


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
06-27-05 10:45 PM

Sorry cheif, I went and looked at your code; add this import up top:

import mx.remoting.debug.NetDebug;

----- Original Message -----
From: "Merrill, Jason" <JMerrill-xFcBdHuE1Uog9ELcbhaJlAC/G2K4zDHf@public.gma
ne.org>
To: "FlashComm Mailing List" <flashcomm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@pub
lic.gmane.org>
Sent: Monday, June 27, 2005 3:30 PM
Subject: RE: [FlashComm] Basic Remoting Problem


Thanks  - I never knew that panel existed. So I added
NetDebug.initialize(); right after my import statements, opened the
panel, and then tested the file in the IDE, but the panel didn't contain
any data.

Jason Merrill   |   E-Learning Solutions   |  icfconsulting.com









[vbcol=seagreen] 
NetConnection[vbcol=seagreen] 
prints[vbcol=seagreen] 
try[vbcol=seagreen] 
have[vbcol=seagreen] 
see[vbcol=seagreen] 
the[vbcol=seagreen] 
please[vbcol=seagreen] 
this[vbcol=seagreen] 

Supported by Fig Leaf Software - http://www.figleaf.com

To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm


=-----------------------------------------------------------
Supported by Fig Leaf Software - http://www.figleaf.com
=-----------------------------------------------------------

To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm






[ Post a follow-up to this message ]



    RE: Basic Remoting Problem  
Merrill, Jason


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
06-27-05 10:45 PM

Thanks.  Still nothing though.  I think part of my problem is
understanding the gateway thing.  This gives a type mismatch error:

var howdyService:Service =3D new
Service("http://localhost/flashservices/gateway/",
=09
"com.macromedia.HelloWorld.cfc",
new Log(),
"remoteservices",
null,=20
null );

Jason Merrill   |   E-Learning Solutions   |  icfconsulting.com









[vbcol=seagreen] 
contain[vbcol=seagreen] 
am[vbcol=seagreen] 
location[vbcol=seagreen] 
no[vbcol=seagreen] 
conditions[vbcol=seagreen] 

=-----------------------------------------------------------
Supported by Fig Leaf Software - http://www.figleaf.com
=-----------------------------------------------------------

To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm






[ Post a follow-up to this message ]



    RE: Basic Remoting Problem  
Merrill, Jason


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
06-27-05 10:45 PM

Let me revise that - this doesn't give a type mismatch, but it also
doesn't trace anything other than "6/27 16:2:4 [INFO] : Invoking
helloWorld on com.macromedia.HelloWorld.cfc"

var howdyService:Service =3D new Service(
"http://localhost/flashservices/gateway/",
new Log(),
"com.macromedia.HelloWorld.cfc",
null,=20
null );

Jason Merrill   |   E-Learning Solutions   |  icfconsulting.com









[vbcol=seagreen] 
would[vbcol=seagreen] 
I'm[vbcol=seagreen] 
but[vbcol=seagreen] 
I[vbcol=seagreen] 
I[vbcol=seagreen] 
contains[vbcol=seagreen] 
have[vbcol=seagreen] 
same[vbcol=seagreen] 
contain[vbcol=seagreen] 

=-----------------------------------------------------------
Supported by Fig Leaf Software - http://www.figleaf.com
=-----------------------------------------------------------

To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm






[ Post a follow-up to this message ]



    RE: Basic Remoting Problem  
Merrill, Jason


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
06-27-05 10:45 PM

OK - somehow I got the panel to work.  Here is what I found:

MethodName: "/1/onStatus"
ResponseURI: (undefined)=20
Parameters (object #2)
.....code: "Server.ResourceNotFound"
.....description: "Service com.macromedia.HelloWorld.cfc not found."
.....details: ""
.....level: "error"
.....type: ""

How does the path to the service work?  I have my cfc in the following
location:

 C:\CFusionMX7\wwwroot\com\macromedia\tes
t\HelloWorld.cfc

Where wwwroot is the root of my webserver.
 C:\CFusionMX7\wwwroot\com\macromedia\tes
t\ is also the same location as
my Flash file.

Jason Merrill   |   E-Learning Solutions   |  icfconsulting.com









[vbcol=seagreen] 
top:[vbcol=seagreen] 
the[vbcol=seagreen] 
[mailto:flashcomm-[vbcol=seagreen] 
(but[vbcol=seagreen] 
-[vbcol=seagreen] 
an[vbcol=seagreen] 
thing[vbcol=seagreen] 
is:[vbcol=seagreen] 
"helloWorld_Result",[vbcol=seagreen] 
icfconsulting.com[vbcol=seagreen] 
of[vbcol=seagreen] 

=-----------------------------------------------------------
Supported by Fig Leaf Software - http://www.figleaf.com
=-----------------------------------------------------------

To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm






[ Post a follow-up to this message ]



    Re: Basic Remoting Problem  
Patrick Mineault


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
06-27-05 10:45 PM

Take out the .cfc in new Service's second parameter.

Patrick Mineault
www.5etdemi.com
www.5etdemi.com/blog

Merrill, Jason wrote:

>OK - somehow I got the panel to work.  Here is what I found:
>
>MethodName: "/1/onStatus"
>ResponseURI: (undefined)
>Parameters (object #2)
>.....code: "Server.ResourceNotFound"
>.....description: "Service com.macromedia.HelloWorld.cfc not found."
>.....details: ""
>.....level: "error"
>.....type: ""
>
>How does the path to the service work?  I have my cfc in the following
>location:
>
> C:\CFusionMX7\wwwroot\com\macromedia\tes
t\HelloWorld.cfc
>
>Where wwwroot is the root of my webserver.
> C:\CFusionMX7\wwwroot\com\macromedia\tes
t\ is also the same location as
>my Flash file.
>
>Jason Merrill   |   E-Learning Solutions   |  icfconsulting.com
>
>
>
>
>
>
>
>
>
>
>
> 
>top:
>
> 
>the
>
> 
>[mailto:flashcomm-
>
> 
>(but
>
> 
>-
>
> 
>an
>
> 
>thing
>
> 
>is:
>
> 
>icfconsulting.com
>
> 
>of
>
> 
>
>Supported by Fig Leaf Software - http://www.figleaf.com
>
>To change your subscription options or search the archive:
>http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
>
>
>


=-----------------------------------------------------------
Supported by Fig Leaf Software - http://www.figleaf.com
=-----------------------------------------------------------

To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm






[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 09:34 AM.      Post New Thread    Post A Reply      
Pages (2): [1] 2 »   Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register