Ask a Question related to Macromedia Flash, Design and Development.
-
Gerry Fung #1
Problem consuming ASP.NET web service in Flash 2004 MX using Web Service Class (WITHOUT Flash Remoting)
This problem really has me stumped. I'm wondering if anyone can help me
with the following problem:
I am using Flash 2004 MX Professional and I have posted a ASP.NET web
service on a web server.
My web server does not allow me to use HTTP-GET, nor does it support Flash
Remoting, hence I am forced to use the Flash MX 2004 Web Service class to
consume the web service.
Reference for Flash MX 2004 Web Service class:
[url]http://www.flash-db.com/services/tutorials/mxclasses/mxwebservices.php?page=2[/url]
I have put the web service and the published Flash files in the same
directory on the same server.
My web service seems to work fine when I consume it using a .NET C# project.
I am also able to consume it in Flash MX actionscript, but only: (1) during
the publish preview mode, or (2) if I run the .SWF file explicitly from the
hard drive. After I publish it, if I reference the Flash .SWF or .HTML file
indirectly from a browser (I.e. http://{servername}/flash/flash.html or
http://{servername}/flash/flash.swf), it does not consume the web service
properly.
From putting trace statements everywhere, I have determined that when I run
the .HTML file indirectly from a web browser, it does not run the code in
"stockResultObj.onResult = function(result)" (see below)
The log I get when it doesn't run properly gives an error message of
"Faulting previously queued call GetNewProducts." (see attachment)
Has anyone ever experienced this problem before? If so, do you have any
suggestions?
Does it have anything to do with the directory path?
Thank you for your help.
Regards,
Gerry
Below is the ActionScript code that I have placed in the first Flash frame
of the second layer:
//************************************************** ************************
****
import mx.services.*;
_global.myCategory = myCategory;
title1_label.text = myCategory;
_global.buttonArray = [btn_1, btn_2, btn_3, btn_4, btn_5, btn_6, btn_7,
btn_8, btn_9, btn_10, btn_11, btn_12];
reloadCatalogue();
function reloadCatalogue(){
stockServiceLog = new Log(Log.VERBOSE);
stockServiceLog.onLog = function(txt) {
text1.text += txt;
}
// Create a new instance of web service called - stockservice.
var stockservice = new WebService(http://{server_name
removed}/asptest/test.aspx?WSDL, stockServiceLog);
var stockResultObj;
// Call the doCompanyInfo method and assign it to the pending call object
to handle results.
stockResultObj = stockservice.GetNewProducts();
stockResultObj.onResult = function(result) {
var xmlRootNode = result;
_global.nodeData = {};
_global.numChildren = xmlRootNode.xmlNodes.length;
for(var i=0; i<xmlRootNode.xmlNodes.length; i++) {
var CurrentNode = xmlRootNode.xmlNodes[i];
_global.buttonArray[i].visible = true;
_global.nodeData["title" + i] = CurrentNode.attributes.title;
_global.nodeData["subtitle" + i] = CurrentNode.attributes.subtitle;
_global.nodeData["picture1" + i] = CurrentNode.attributes.picture1;
_global.nodeData["button_text" + i] =
CurrentNode.attributes.button_text;
_global.nodeData["description" + i] =
CurrentNode.attributes.description;
_global.buttonArray[i].label = _global.nodeData["button_text"+i];
}
}
stockResultObj.onFault = function(fault) {
// If there is any error such as the service not working, the
onFault handler will be invoked.
trace(fault.faultCode + "," + fault.faultstring);
}
}; //end function reloadCatalogue
Gerry Fung Guest
-
I don't think Flash Remoting service was installed withColdfusion
Hi, everytime I try to typing in this url, http://localhost:8500/flashservices/gateway, I get a 404 error. Reading articles I see that the flash... -
flash remoting not finding web service
I recently tried flash remoting with flash forms and have encountered a problem i've been on for over a day now. I downloaded this sample flash... -
Flash remoting error calling cfc:Service
I have tried installing CFMX 7 on 3 computers and continue to get the following error when trying to use Flash remoting. Error when calling... -
Error: No Service is known to Flash Remoting MX.
I'm running an integrated install with ColdFusion 6.1 and Flex 1.5 as per... -
Flash not consuming web service properly
I'm having a very frustrating time using the WebService class in Flash MX 2004. I have a functioning web service which passes my flash application...



Reply With Quote

