all groups > macromedia flash flash remoting > june 2004 >
You're in the

macromedia flash flash remoting

group:

.Net remoting with AS2 remoting components and classes


.Net remoting with AS2 remoting components and classes titouille
6/18/2004 2:41:30 PM
macromedia flash flash remoting:
Hi hello everybody !!

First, sorry for my poor english, this isn't my mother tongue :)

Ok... I want to use the new FlashRemoting AS2 components and classes
with .Net assembly...

So I create a very simple assembly, with just one method who return a
"hello world" string. I add FlashGateway.dll reference to my project.
this is the code of my assembly :

using System;
using FlashGateway;

namespace ProjetTest.test
{
public class MyClass
{
public MyClass()
{
}

public string getString ()
{
return "hello world";
}
}
}


After, I made a new Directory, set up an aspx page who contains the
minimum code :

<%@ Page Language="C#" %>
<html>
<head>
</head>
<body>
</body>
</html>

and called "gateway.aspx"

After that, I create a sub directory called bin, and add my DLL into...

structure :
Root (directory)
--> gateway.aspx
--> bin (directory)
--------> ProjetTest.dll
--------> flashgateway.dll

I launch cassini webserver from the gateway.aspx. so the root directory
of the webserver is the Root directory of my structure.

I made a new fla, who contains the following code :


import mx.remoting.*;
import mx.rpc.*;

NetDebug.init ();

function onResults(r:ResultEvent) : Void {
trace (r);
}

function onError(fault:FaultEvent) : Void {
trace("There was a problem: " + fault.fault.faultstring);
trace("The faultcode is: " + fault.fault.faultcode);
trace("The detail: " + fault.fault.detail);
trace("The error class name is: " + fault.fault.type);

}

var s:Service = new Service ("http://localhost/gateway.aspx", null,
"ProjetTest.test.MyClass", null, null);

var pc:PendingCall = s.getString ();
pc.responder = new RelayResponder(this, "onResults", "onError" );




And when I compile my fla to test it, the connection is etablished, and
the call of the method too, but no return of any type... simply no return...

NetDebug trace of connection :

ConnectString: "http://localhost/gateway.aspx"
Date: (undefined)
ID de débogage: 0
Type d'événement: "Connect"
URL de l'animation: "file:///E|/Documents de Titouille/csharp/test/TEST.swf"
Protocole: "http"
Source: "Client"
Heure: (undefined)

NetDebug trace of method call :

Date: (undefined)
ID de débogage: 0
Type d'événement: "Call"
MethodName: "ProjetTest.test.MyClass.getString"
URL de l'animation: "file:///E|/Documents de Titouille/csharp/test/TEST.swf"
Protocole: "http"
Source: "Client"
Heure: (undefined)
Parameters (object #1)
......Aucune propriété



Before installing remoting AS2, I have tried the AS1 components for
remoting, last month, and all was correct, connection, call, return...
So if anyone can explain me who I'm lost (maybe the structure, the
gateway, ...), I will be very happy and can continue my developement.


Many thanks in advance for any solution, way, url, tutorial, ... :)


Re: .Net remoting with AS2 remoting components and classes titouille
6/21/2004 5:02:57 PM
Ok... just for information... If anyone know any tutorial who explain
the way with .Net assembly (or webServices or ASP.Net page) and AS2
remoting, it would be great !

I have following the petepx tutorial for my example, but no response of
the server, like I have explained...

Thanks in advance for an answer.


Thierry


titouille a écrit :
[quoted text, click to view]
Re: .Net remoting with AS2 remoting components and classes titouille
6/21/2004 7:31:36 PM
Ok, all problem become with the missing of the web.config file... shame
on me... I have missed the starting point..
So I have created a web.config file on the root (same place with
gateway.aspx) and added these lines :

<httpModules>
<add name="GatewayController"
type="FlashGateway.Controller.GatewayController,flashgateway" />
</httpModules>


And all work :)

Thierry


titouille a écrit :

[quoted text, click to view]
AddThis Social Bookmark Button