Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / Flash / Flash Remoting / April 2006



Tip: Looking for answers? Try searching our database.

helloWorld troubles

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
j_mcwatters - 25 Apr 2006 10:33 GMT
Hello World!

Well at least that worked.

I'm trying to follow the "Building a Hello World application with Flash
Remoting" example at
http://livedocs.macromedia.com/flashremoting/mx2004/using_flash_remoting/wwhelp/
wwhimpl/js/html/wwhelp.htm.

I've followed it to the letter, but nothing is appearing in my text field.
I have dragged both the remoting and remotingDebugging classes onto the stage,
and I am using the following actionscript :

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;
import mx.remoting.debug.NetDebug;
 NetDebug.initialize();

// connect to service and create service object
    var howdyService:Service = new Service(
            "http://localhost:8500/flashservices/gateway",
            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",
"serviceFunctionName_Fault" );  

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

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

I do have a dynamic text field named messageDisplay on the stage.

When I run my movie, the output says, "4/19 7:47:42  : Invoking helloWorld on
remoteservices"
and my NetConnection Debugger lists 4 events.

#1)  Connect - Summary: ConnectString:
"http://localhost:8500/flashservices/gateway"
                           Details: ConnectString:
"http://localhost:8500/flashservices/gateway"
DebugId: "0"
EventType: "Connect"
MovieUrl:
"file:///C|/CFusionMX7/wwwroot/CFIDE/DEV/FlashRemoting/MX2004/serviceTest.swf"
Protocol: "http"
Source: "Client"
Time: 1145404542873
Date (object #1)
....."Wed Apr 19 07:55:42 GMT+0800 2006"

#2) Call - Summary: MethodName: "remoteservices.helloWorld"
Parameters (object #2)
.....No properties
                  Details: DebugId: "0"
EventType: "Call"
MethodName: "remoteservices.helloWorld"
MovieUrl:
"file:///C|/CFusionMX7/wwwroot/CFIDE/DEV/FlashRemoting/MX2004/serviceTest.swf"
Protocol: "http"
Source: "Client"
Time: 1145404542883
Date (object #1)
....."Wed Apr 19 07:55:42 GMT+0800 2006"
Parameters (object #2)
.....No properties

#3 AmfStatusCall - Summary: MethodName: "/1/onStatus"
ResponseURI: (undefined)
Parameters (object #2)
.....code: "Server.ResourceNotFound"
.....description: "Service remoteservices not found."
.....details: ""
.....level: "error"
.....type: ""

Details: EventType: "AmfStatusCall"
MethodName: "/1/onStatus"
ResponseURI: (undefined)
Source: "Server"
Time: 1145404544756
DebugId: "0"
MovieUrl:
"file:///C|/CFusionMX7/wwwroot/CFIDE/DEV/FlashRemoting/MX2004/serviceTest.swf"
Protocol: "http"
Date (object #1)
....."Wed Apr 19 07:55:44 GMT+0800 2006"
Parameters (object #2)
.....code: "Server.ResourceNotFound"
.....description: "Service remoteservices not found."
.....details: ""
.....level: "error"
.....type: ""

#4 Status - Summary: Status (object #2)
.....code: "Server.ResourceNotFound"
.....description: "Service remoteservices not found."
.....details: ""
.....level: "error"
.....type: ""
Details: DebugId: "0"
EventType: "Status"
MovieUrl:
"file:///C|/CFusionMX7/wwwroot/CFIDE/DEV/FlashRemoting/MX2004/serviceTest.swf"
Protocol: "http"
Source: "Client"
Time: 1145404544986
Date (object #1)
....."Wed Apr 19 07:55:44 GMT+0800 2006"
Status (object #2)
.....code: "Server.ResourceNotFound"
.....description: "Service remoteservices not found."
.....details: ""
.....level: "error"
.....type: ""

My folder structure is as follows,  serviceTest.fla and serviceTest.swf  are
at the root. There is a subfolder called "remoteservices" and in that folder is
the file called helloWorld.cfm.

I'm sorry for the length of this reply, but I really want to learn this stuff
and I have been struggling for a couple days on just this.
If anyone could lend a hand or advice, I would be really greatful.

- J
j_mcwatters - 25 Apr 2006 13:32 GMT
Hello again,

I've figured out what I did wrong. I didn't realize, even though I had read
it, that the path to the service name had to be absolute from the wwwroot
folder of coldFusion. I had thought it could be relative to the swf that was
calling the service. Ooops.

In this case the attribute "remoteservices" should have been
"subfolder.subfolder.remoteservices" as my project resides two levels down from
the wwwroot dir.

So there you go.

- J
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.