macromedia flash flash remoting:
Check this out, it's pissing me off majorly. The web services panel in Flash
shows 2 functions in the web service in question, so it definately exists; but
when I call the last function(a very simple one just querying the entire
database), it screws up.
Here is my Cold Fusion code:
<cfcomponent displayname="flavorInput">
<cffunction name="flavorInput" access="remote" returntype="string">
<cfargument name="wsNumber" type="string" required="true">
<cfargument name="productName" type="string" required="true">
<cfargument name="productType" type="string" required="false">
<cfargument name="productPhase" type="string" required="false">
<cfargument name="solubility" type="string" required="false">
<cfargument name="natArt" type="string" required="false">
<cfargument name="flashPoint" type="string" required="false">
<cfargument name="AYE" type="string" required="false">
<cfargument name="MSG" type="string" required="false">
<cfargument name="HVP" type="string" required="false">
<cfargument name="IG" type="string" required="false">
<cfargument name="kosher" type="string" required="false">
<cfargument name="gmoFree" type="string" required="false">
<cfargument name="vegetarian" type="string" required="false">
<cfargument name="vegan" type="string" required="false">
<cfargument name="organic" type="string" required="false">
<cfargument name="kosherHalal" type="string" required="false">
<cfargument name="kosherParve" type="string" required="false">
<cfargument name="poly80" type="string" required="false">
<cfargument name="isPublic" type="string" required="false">
<cfargument name="chefStars" type="string" required="false">
<cfargument name="hedonicRating" type="string" required="false">
<cfargument name="priceRating" type="string" required="false">
<cfargument name="comments" type="string" required="false">
<cfargument name="descriptors" type="string" required="false">
<cfargument name="percentage1" type="string" required="false">
<cfargument name="percentage2" type="string" required="false">
<cfargument name="percentage3" type="string" required="false">
<cfargument name="percentage4" type="string" required="false">
<cfargument name="percentage5" type="string" required="false">
<cfargument name="application1" type="string" required="false">
<cfargument name="application2" type="string" required="false">
<cfargument name="application3" type="string" required="false">
<cfargument name="application4" type="string" required="false">
<cfargument name="application5" type="string" required="false">
<cfset myResult="Flavor Successfully Added!!">
<cfquery name="inputQuery" datasource="wynn">
INSERT INTO flavors (wsNumber, productName, productType, productPhase,
solubility, natArt, flashPoint, AYE, MSG, HVP, IG, kosher, gmoFree, vegetarian,
vegan, organic, isPublic, chefStars, hedonicRating, priceRating, comments,
descriptors, percentage1, application1, application2, application3,
application4, application5, percentage2, percentage3, percentage4, percentage5,
kosherHalal, kosherParve, poly80)
VALUES ('#arguments.wsNumber#', '#arguments.productName#',
'#arguments.productType#', '#arguments.productPhase#',
'#arguments.solubility#', '#arguments.natArt#', '#arguments.flashPoint#',
'#arguments.AYE#', '#arguments.MSG#', '#arguments.HVP#', '#arguments.IG#',
'#arguments.kosher#', '#arguments.gmoFree#', '#arguments.vegetarian#',
'#arguments.vegan#', '#arguments.organic#', '#arguments.isPublic#',
'#arguments.chefStars#', '#arguments.hedonicRating#',
'#arguments.priceRating#', '#arguments.comments#', '#arguments.descriptors#',
'#arguments.percentage1#', '#arguments.application1#',
'#arguments.application2#', '#arguments.application3#',
'#arguments.application4#', '#arguments.application5#',
'#arguments.percentage2#', '#arguments.percentage3#',
'#arguments.percentage4#', '#arguments.percentage5#',
'#arguments.kosherHalal#', '#arguments.kosherParve#', '#arguments.poly80#')
</cfquery>
<cfreturn myResult>
</cffunction>
<cffunction name="getAllFlavors" access="remote" returntype="Query">
<cfset var queryFlavors = "" />
<cfquery datasource="wynn" name="queryFlavors">
SELECT *
FROM flavors
</cfquery>
<cfreturn queryFlavors>
</cffunction>
</cfcomponent>
Here is my actionscript code to call the function:
if (isGatewayOpen == null) {
isGatewayOpen = true;
NetServices.setDefaultGatewayUrl("
http://www.bigsecret.com/flashservices/gatewa y");
findFlavorConnection = NetServices.createGatewayConnection();
flavorService =
findFlavorConnection.getService("
http://www.bigsecret.com/flavorInput.cfc?wsdl",
this);
}
submitFlavor = function () {
var params = new Object();
params.wsNumber = wsNumber.text;
params.productName = productName.text;
params.productType = productType.getSelectedItem().label;
params.productPhase = productPhase.getSelectedItem().label;
params.solubility = solubility.getSelectedItem().label;
params.natArt = natArt.getSelectedItem().label;
params.flashPoint = flashPoint.text;
params.AYE = AYE.selected;
params.MSG = MSG.selected;
params.HVP = HVP.selected;
params.IG = IG.selected;
params.kosher = kosher.selected;
params.gmoFree = gmoFree.selected;
params.vegetarian = vegetarian.selected;
params.vegan = vegan.selected;
params.organic = organic.selected;
params.isPublic = isPublic.getSelectedItem().label;
params.chefStars = chefStars.getSelectedItem().label;
params.hedonicRating = hedonicRating.getSelectedItem().label;
params.priceRating = priceRating.getSelectedItem().label;
params.comments = comments.text;
if (descriptors.getSelectedItem().label == undefined) {
params.descriptors = "";
} else {
params.descriptors = descriptors.getSelectedItem().label;
}
params.percentage1 = percentage1.text;
params.application1 = application1.getSelectedItem().label;
params.application2 = application1.getSelectedItem().label;
params.application3 = application1.getSelectedItem().label;
params.application4 = application1.getSelectedItem().label;
params.application5 = application1.getSelectedItem().label;
params.percentage2 = percentage2.text;
params.percentage3 = percentage3.text;
params.percentage4 = percentage4.text;
params.percentage5 = percentage5.text;
params.kosherHalal = kosherHalal.selected;
params.kosherParve = kosherParve.selected;
params.poly80 = poly80.selected;
statusText.text = "Adding flavor to database...";
flavorService.flavorInput(params);
};
function flavorInput_Result(result) {
var params = new Object();
statusText.text = result;
flavorService.getAllFlavors();
}
onStatus = function (info) {