Groups | Blog | Home
all groups > macromedia flash flash remoting > september 2004 >

macromedia flash flash remoting : Has this problem fixed yet?


AndyLo
9/27/2004 5:39:18 AM
Unable to create webservice proxy. Please ensure the Microsoft.NET Framework
SDK is installed.

As a newbie to Flash I am trying to use Flash MX 2004 Pro (ver 7.2, developing
with AS2) and Remoting to connect to my newly created (yet simple) .NET
WebServer. The as code as follow:


import mx.remoting.Service;
import mx.remoting.PendingCall;
import mx.remoting.RecordSet;
import mx.remoting.DataGlue;

import mx.controls.DataGrid;
import mx.controls.gridclasses.DataGridColumn;

import mx.rpc.RelayResponder;
import mx.rpc.FaultEvent;
import mx.rpc.ResultEvent;

class CustomerListForm extends mx.screens.Form
{
function CustomerListForm()
{
var dgCustomerList:mx.controls.DataGrid;
}

function CallService()
{
var webService:Service = new Service(
"http://localhost/flashremoting/gateway.aspx",
null,
"http://localhost/ProjectInitialize/Service1.asmx?wsdl",
null,
null);

var pc:PendingCall = webService.GetCustomerList();
pc.responder = new RelayResponder(this, "getCustomer_List", "getFail_List");
}

function getCustomer_List(re:ResultEvent):Void
{
trace("Ok");
trace(re);
}

function getFail_List(fe:FaultEvent):Void
{
trace("Fail");
trace(fe.fault.faultstring);
}
}


Obviously I got that message at the top from the trace output.

I have look thru both this forum and google and no one can provide a real
solution to it (or it just become so well known and just me got left out in the
world?) Is there a true fix to this problem.

Flash MX 2004 pro already given me enough headaches for the pass 4 days....
always been a CF dieharder and loved it and never thought MM can produce
something like Flash MX2004 to give me dreadful experience like this. :(
jameslyon
9/27/2004 6:06:12 PM
My thoughts are:

Is your .net webserver and webservice set up (including using port 80 for remoting calls)?

The problem must be related to Remoting and the web service because the as is fine.

AndyLo
9/27/2004 10:40:15 PM
because the as is fine

I know... my code always perfect :) :p

An update to the problem:

Finally I took the step/advice to add a ASPNET user into the net publish
folder (in my case: \inetpub\wwwroot) I have add different combination of
permission to the ASPNET user (including Admin rights)... then flash give me
another error message!! x-(

File or assembly name Service1.dll, or one of its dependencies, was not found.

I digged in a little deeper and found out that is something to do with the
permit rights again, as getting very close to an angry flash developer (and
newbie) I change the system permission level but go into my Windows directory
which contains a bunch of config setting to change the permission to SYSTEM
level (which mean whatever login can access anything)... but still can't fix
the problem and the same message is output!!

(Refer to the permission change: http://p2p.wrox.com/topic.asp?TOPIC_ID=1131)

Gezz... I am just a software developer and I don't know why I need to do all
this system admin crap (and it still not working anyway! x-( ) so if some
genius, or experts from MM can shed some light on me that would help not only
me but a lot of people out there!
Pete
10/1/2004 7:17:28 PM
The problem isn't really something that can be "fixed" - Microsoft took away
programmatic access to their WSDL tools and makes users call their command
line tools, so the gateway tries to do some things for you, but you should
really try to create web service proxies yourself.

I believe your particular issue is that the flashgateway.dll can't either
execute wsdl.exe, write the resulting web services proxy C# file
SomeWebService.cs file to disk, or execute csc.exe to compile the
SomeWebService.cs file into a SomeWebService.dll in the LAC.

Perhaps you don't have the Framework SDK installed in the default location
or perhaps you don't have wsdl.exe and csc.exe in your system environment
PATH? Perhaps you need to give the ASP.NET user write permissions to the
/bin subdirectory (the Local Assembly Cache (LAC)) or... which I suggest you
try this way in future... manually creating the web service proxy yourself.

You use the Microsoft.NET Framework SDK tool "wsdl.exe" to create a C# stub
class to act as a proxy to handle calls from the gateway to the webservice.
But, of course, since this generated proxy is just C# source - it has to be
compiled into an assembly. For this, you use good ol' csc.exe and output the
compiled code as a library.

Note: that the service name is not picked based on the WSDL URL. It comes
from inside the WSDL format - specifically the "service" name definition -
which for .asmx files is usually towards the end of the file.

Here's an example of the command line args required to generate a proxy
assembly:

wsdl.exe "nologo /o:SomeWebService.cs
http://somewhere.com/something/somethingelse.asmx?wsdl
csc.exe /out:SomeWebService.dll /t:library SomeWebService.cs

This assembly would go next to the flashgateway.dll in your LAC.

AddThis Social Bookmark Button