all groups > macromedia flash flash remoting > february 2007 >
You're in the

macromedia flash flash remoting

group:

Remoting works twice, then "Error Opening URL"


Remoting works twice, then "Error Opening URL" jhancik
2/28/2007 4:04:24 PM
macromedia flash flash remoting:
Hello All!

I have constructed a simple "Hello World" cfc in CFMX 7 and am accessing it
through Remoting. It works fine twice and then anything after that I get the
indecipherable "Error Opening URL" msg.

I have created three separate cfcs (each doing the same thing more or less) to
test against; have created three different services (each using the same
connection, however) and no matter which combination I try, I get the same
behavior: 2 successes and then failures.

I have tried locally, loaded to the domain, loaded to a separate domain, etc.
and still no dice. Here's a sample:

// import necessary libraries
import mx.styles.*;
import mx.remoting.*;
import mx.rpc.*;
import mx.services.Log;
import mx.remoting.debug.NetDebug;

NetDebug.initialize();

// functions that handle the remote results
function sayWhat(str) {
var sayWhatPC:PendingCall = projectReg.sayWhat(str);
sayWhatPC.responder = new RelayResponder( this, "sayWhat_Result",
"sayWhat_Fault" );
}

function sayWhat_Result(result:ResultEvent) {
trace("sayWhat success result:");
trace(result.result);
_root.debug_txt.text = result.result;
}

function sayWhat_Fault(fault:FaultEvent) {
trace("sayWhat fault result:");
trace(fault.fault.faultstring);
_root.debug_txt.text =fault.fault.faultstring;
}

// connect to service and create service object
var srvc = "http://ourserver.com/flashservices/gateway";
var projectReg:Service = new Service(srvc, new Log(),
"project.com.registration", null, null );

NOTE: The last bit of code above does not seem to want to play nice posting
to these forums <sigh>. there really is no double var in front of the service
address!
Re: Remoting works twice, then "Error Opening URL" jhancik
2/28/2007 6:04:49 PM
Ok,

I rebuilt my test app using the remoting component instead of AS.

When launched from an URL in the same domain the app works as desired (you can
get responses repeatedly).

However, when launched locally (either as a SWF or Projector using either
local access or network access) the app still only returns values twice.
Subsequent attempts result in Error Opening URL error.

As my app is being designed to run locally this concerns me - any thoughts?

J-
Re: Remoting works twice, then "Error Opening URL" tonyhigham
2/28/2007 8:30:53 PM
I knew I had seen this somewhere else before, but since I ended up doing my
remoting with AMFPHP, it took me a few minutes to find it:

http://www.northcode.com/forums/showthread.php?p=38133

Very simple if it works for you. :)
Re: Remoting works twice, then "Error Opening URL" jhancik
3/1/2007 12:49:51 AM
This is exactly the experience I was having!

The related article fixed this and was totally painless!

AddThis Social Bookmark Button