all groups > macromedia flash flash remoting > january 2005 >
You're in the

macromedia flash flash remoting

group:

I just don't get it!!!!


I just don't get it!!!! Tomdogggg
1/5/2005 9:47:34 PM
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) {
Re: I just don't get it!!!! ji2005
1/6/2005 5:25:13 AM
Originally posted by: Tomdogggg
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.<BR><BR>Here is my Cold Fusion code:<BR><cfcomponent
displayname="flavorInput"><BR> <cffunction name="flavorInput" access="remote"
returntype="string"><BR> <cfargument name="wsNumber" type="string"
required="true"><BR> <cfargument name="productName" type="string"
required="true"><BR> <cfargument name="productType" type="string"
required="false"><BR> <cfargument name="productPhase" type="string"
required="false"><BR> <cfargument name="solubility" type="string"
required="false"><BR> <cfargument name="natArt" type="string"
required="false"><BR> <cfargument name="flashPoint" type="string"
required="false"><BR> <cfargument name="AYE" type="string"
required="false"><BR> <cfargument name="MSG" type="string"
required="false"><BR> <cfargument name="HVP" type="string"
required="false"><BR> <cfargument name="IG" type="string"
required="false"><BR> <cfargument name="kosher" type="string"
required="false"><BR> <cfargument name="gmoFree" type="string"
required="false"><BR> <cfargument name="vegetarian" type="string"
required="false"><BR> <cfargument name="vegan" type="string"
required="false"><BR> <cfargument name="organic" type="string"
required="false"><BR> <cfargument name="kosherHalal" type="string"
required="false"><BR> <cfargument name="kosherParve" type="string"
required="false"><BR> <cfargument name="poly80" type="string"
required="false"><BR> <cfargument name="isPublic" type="string"
required="false"><BR> <cfargument name="chefStars" type="string"
required="false"><BR> <cfargument name="hedonicRating" type="string"
required="false"><BR> <cfargument name="priceRating" type="string"
required="false"><BR> <cfargument name="comments" type="string"
required="false"><BR> <cfargument name="descriptors" type="string"
required="false"><BR> <cfargument name="percentage1" type="string"
required="false"><BR> <cfargument name="percentage2" type="string"
required="false"><BR> <cfargument name="percentage3" type="string"
required="false"><BR> <cfargument name="percentage4" type="string"
required="false"><BR> <cfargument name="percentage5" type="string"
required="false"><BR> <cfargument name="application1" type="string"
required="false"><BR> <cfargument name="application2" type="string"
required="false"><BR> <cfargument name="application3" type="string"
required="false"><BR> <cfargument name="application4" type="string"
required="false"><BR> <cfargument name="application5" type="string"
required="false"><BR> <cfset myResult="Flavor Successfully
Added!!"><BR> <cfquery name="inputQuery" datasource="wynn"><BR> 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)<BR> 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#')<BR> </cfquery><BR> <cfreturn
myResult><BR> </cffunction><BR> <BR> <BR> <cffunction name="getAllFlavors"
access="remote" returntype="Query"><BR> <cfset var queryFlavors = ""
/><BR><BR> <cfquery datasource="wynn" name="queryFlavors"><BR> SELECT *
<BR> FROM flavors<BR> </cfquery><BR><BR> <cfreturn
queryFlavors><BR> </cffunction><BR></cfcomponent><BR><BR><BR><BR>Here is my
actionscript code to call the function:<BR><BR>if (isGatewayOpen == null)
{<BR> isGatewayOpen =
true;<BR> NetServices.setDefaultGatewayUrl("http://www.bigsecret.com/flavorInput
..cfc?wsdl", this);<BR>}<BR>submitFlavor = function () {<BR> var params = new
Object();<BR> params.wsNumber = wsNumber.text;<BR> params.productName =
productName.text;<BR> params.productType =
productType.getSelectedItem().label;<BR> params.productPhase =
productPhase.getSelectedItem().label;<BR> params.solubility =
solubility.getSelectedItem().label;<BR> params.natArt =
natArt.getSelectedItem().label;<BR> params.flashPoint =
flashPoint.text;<BR> params.AYE = AYE.selected;<BR> params.MSG =
MSG.selected;<BR> params.HVP = HVP.selected;<BR> params.IG =
IG.selected;<BR> params.kosher = kosher.selected;<BR> params.gmoFree =
gmoFree.selected;<BR> params.vegetarian = vegetarian.selected;<BR> params.vegan
= vegan.selected;<BR> params.organic = organic.selected;<BR> params.isPublic =
isPublic.getSelectedItem().label;<BR> params.chefStars =
chefStars.getSelectedItem().label;<BR> params.hedonicRating =
hedonicRating.getSelectedItem().label;<BR> params.priceRating =
priceRating.getSelectedItem().label;<BR> params.comments =
comments.text;<BR> if (descriptors.getSelectedItem().label == undefined)
{<BR> params.descriptors = "";<BR> } else {<BR> params.descriptors =
descriptors.getSelectedItem().label;<BR> }<BR> params.percentage1 =
percentage1.text;<BR> params.application1 =
application1.getSelectedItem().label;<BR> params.application2 =
application1.getSelectedItem().label;<BR> params.application3 =
application1.getSelectedItem().label;<BR> params.application4 =
application1.getSelectedItem().label;<BR> params.application5 =
application1.getSelectedItem().label;<BR> params.percentage2 =
percentage2.text;<BR> params.percentage3 =
percentage3.text;<BR> params.percentage4 =
percentage4.text;<BR> params.percentage5 =
percentage5.text;<BR> params.kosherHalal =
kosherHalal.selected;<BR> params.kosherParve =
kosherParve.selected;<BR> params.poly80 = poly80.selected;<BR> statusText.text
= "Adding flavor to
database...";<BR> flavorService.flavorInput(params);<BR>};<BR>function
flavorInput_Result(result) {<BR> var params = new Object();<BR> statusText.text
AddThis Social Bookmark Button