PDA

View Full Version : ***HELP! /flashservices/gateway issues


JoeyClams
02-17-2005, 02:23 PM
Hi All,

I'm using Remoting with CFCs and I seem to be having problems connecting to the gateway. I'm using Flash MX2004 with the new remoting components for AS2. I'm viewing my swf via an IP address through the browser.

In the status of the browser (and in the NetConnection Debugger) I can see it's trying to connect (in the NetConnection Debugger I get "NetConnection.Call.Failed - Error: HTTP Status 405").

The first thing that's supposed to happen in my CFC is to send me an email with CFMAIL. This line of the code is never getting reached.

I've done remoting before mith MX and the old components and I got that working, but I remember that when I browsed to the gateway url in the browser I would get a blank page (which meant the gateway existed and was working, I believe). Now with MX2004 and the AS2 components, when I try to browse to the gateway I don't get a blank page but rather I get "Page Cannot Be Found." I"ve tried adding "/index.cfm" to the end of the gatewayURL and that doesn't work either.

Does anyone have any ideas what could be going on? Here's my AS2 remoting code:

// I've already added the 2 debugging components to the stage

// Include required class files
import mx.remoting.Service;
import mx.services.Log;
import mx.rpc.RelayResponder;
import mx.remoting.PendingCall;
import mx.remoting.RecordSet;
import mx.rpc.FaultEvent;
import mx.rpc.ResultEvent;
// to use the NetConnection Debugger
import mx.remoting.debug.NetDebug;
NetDebug.initialize();

// Create "memberloginService" Service Object; Set Gateway URL; Connect to Service
// service name: CFC.memberlogin
var memberloginService:Service = new Service(
"http://<!--- ip address goes here --->/flashservices/gateway", // gatewayURL
new Log(), // Log object, to which debugging messages are sent
"CFC.memberlogin", // service name
null, // connection parameter
null // responder parameter
);

// Call the web service "f_MemberLogin()" method
var pc:PendingCall = memberloginService.f_MemberLogin(myObj); // Pending Call object

// Tell the service what methods handle result and fault conditions
pc.responder = new RelayResponder(
this, // the object that contains the methods that handles the values returned by the service function
"f_MemberLogin_Result", // the result handler method
"f_MemberLogin_Fault" // the fault handler method
);

// Result Event
function f_MemberLogin_Result(result:ResultEvent) {
// success returned from service
var resultStr:Object = result.result;

if (resultStr == 1) {
// Login Successful.
_root.mainclip.message.gotoAndStop(2);
}

else if (resultStr == 0){
// Login Failed.
_root.mainclip.gotoAndStop(2);
_root.mainclip.message.gotoAndStop(3);
}

}

// Fault Event
function f_MemberLogin_Fault(fault:FaultEvent) {
// fault returned from service
var faultStr:Object = fault.fault.faultstring;
}

stop();

Any help would be GREATLY appreciated - - got a time sensitive project I've been struggling with and this issue is holding me back - TIA

JoeyClams
02-18-2005, 01:38 PM
Ok some progress - I got the remoting gateway to work locally via the Flash client (CTRL+Enter), but still cannot get it to work via a web browser with the IP address.

To get it to function via the Flash client, I needed to:

1.) USE THE COMPUTER NAME in the gatewayURL - - NOT "localhost" or the IP address. I have no idea why this is. It works though. No documentation on this whatsoever that I can find. So, instead of
"http://localhost/flashservices/gateway" you must use "http://<!--- computer name --->/flashservices/gateway"

2.) I needed to refer to the service path differently. Instead of just the name of the subfolder containing the CFCs and then "." then the CFC name, I needed to put the entire physical path to the CFC from the root folder of the IIS default web site.

So, instead of "CFC.testService" I needed to put "TestSite.subfolder1.CFC.testService"

I suspect these issues have something to do with the way the default site is set up in IIS. I still can't get the gateway to be recognized when I try to access the .swf via a web browser and using the local IP. Does anyone have any ideas why I'm not able to use the dev IP address in the gateway url and why I can't connect to the gateway via a web browser using the IP address??

ThxInAdv

JoeyClams
02-18-2005, 02:41 PM
Ok, finally got it figured out - it depends on how your IIS default web site is configured:

When viewing your .swf via a web browser with an IP, you have to reference the gateway and the path to CFCs according to the IP and location of the IIS Default Web Site. So, say you have the following scenario:

-You are developing locally on your own machine. The name of this computer is "MyComp".

-You've set up an IP to point to your "TestSite" folder on your C drive. Let's say this IP is "111.11.11.13". In this folder are the files you're testing, "test.swf" and "test.html".

- The IP address of the default IIS web site is "111.11.11.20". This points to the ROOT directory of your C drive.

- Your CFCs are located in a subfolder called "CFC" in the folder "TestSite". In this CFC folder there's a CFC with the name of "memberlogin.cfc".

TEST SCENARIO 1: Test Your .SWF Via a Web Browser:

1. The GatewayURL = "http://111.11.11.20/flashservices/gateway". (you can check this in the browser - when you go to this url you will get the "blank" page not the "page not found" page - - this means you've hit the virtual directory for the gateway).

2. The path to the CFC memberlogin service = "TestSite.CFC.memberlogin"

3. In your browser, you browse to "http://111.11.11.20/testsite/test.html" to test your movie.

TEST SCENARIO 2: Test Your .SWF Via the Flash Client (CTRL + Enter)

1. The GatewayURL = "http://MyComp/flashservices/gateway"

2. The path to the CFC memberlogin service = "TestSite.CFC.memberlogin"


Anyone else have any additions to this feel free to post 'em ...