Sunday, March 28, 2010

Primitive Type Returned when trying to...

Dev Environment:?XP Pro, ColdFusion 9, ColdFusion Builder 1, FlashBuilder 4, Firebird 2.1.2, Jaybird 2.1.6

Error message recieved while trying to connect data to a grid in FlashBuilder 4:
--------------------------------------------------------------
Primitive Type Returned

The operation returned a response of the type ''Object''

You may either update server code to fix the returned data or Click OK to set
''Object'' as the return type of this operation
---------------------------------------------------------------


Here is the CF9 component code:?
(This is the same code as for the other successful grid,
except for every occurrance of SES in the code below, it is
replaced with ''SBJ'' in the other code for the working grid)

?%26lt;cffunction name=''getSESs'' output=''false'' access=''remote'' returntype=''any'' %26gt;
?%26lt;cfargument name=''par_guid'' required=''true'' /%26gt;

?%26lt;!--- Fetch a list photo sessions whose par_guid field
?value matches the given value ---%26gt;
?
?%26lt;cfset var qSESs=''''%26gt;
?%26lt;cfquery name=''qSESs'' datasource=''cfBAA_jdbc''%26gt;
?SELECT * FROM BAA_SES
?WHERE PAR_GUID =
?%26lt;CFQUERYPARAM CFSQLTYPE=''CF_SQL_VARCHAR'' VALUE=''#ARGUMENTS.par_guid#''%26gt;
?ORDER BY SES_NMBR
?%26lt;/cfquery%26gt;
?%26lt;cfreturn qSESs%26gt;
?%26lt;/cffunction%26gt;

----------------------------?Please see the attached image file for a ''story board'' of what I did to get this error ---------------------

Primitive Type Returned when trying to...

Flash builder's ''Configure Return Type'' dialog recognizes this OK and it works

?%26lt;!--- Fetch a single session record ---%26gt;
%26lt;cffunction name=''getSES'' output=''false'' access=''remote'' returntype=''any'' %26gt;
%26lt;cfargument name=''obj_guid'' type=''string'' required=''true'' /%26gt;
%26lt;cfset var qSES=''''%26gt;
%26lt;cfquery name=''qSES'' datasource=''cfBAA_odbc''%26gt;
SELECT *
FROM BAA_SES
WHERE OBJ_GUID = %26lt;CFQUERYPARAM CFSQLTYPE=''CF_SQL_VARCHAR'' VALUE=''#ARGUMENTS.obj_guid#''%26gt;
%26lt;/cfquery%26gt;
%26lt;cfreturn qSES%26gt;
%26lt;/cffunction%26gt;

Flash builder's ''Configure Return Type'' dialog doesn't recognize this.?It always returns ''Object'' which is wrong.?I have done several CF server restarts, PC reboots, several FB4 ''re-sync with server file''.?Refuses to recognise this.

?%26lt;cffunction name=''getIMG'' output=''false'' access=''remote'' returntype=''any'' %26gt;
?%26lt;cfargument name=''obj_guid'' type=''string'' required=''true'' /%26gt;
?%26lt;cfset var qIMG=''''%26gt;
?%26lt;cfquery name=''qIMG'' datasource=''cfBAA_odbc''%26gt;
?SELECT *
?FROM BAA_IMG
?WHERE OBJ_GUID = %26lt;CFQUERYPARAM CFSQLTYPE=''CF_SQL_VARCHAR'' VALUE=''#ARGUMENTS.obj_guid#''%26gt;
?%26lt;/cfquery%26gt;
?%26lt;cfreturn qIMG%26gt;
?%26lt;/cffunction%26gt;

What am I doing wrong??The rest of my source for my ''learning project'' is attached.

Primitive Type Returned when trying to...

Problem solved.?Ok, anyone following in my foot steps.?The value that you enter into the ''Configure Return Type'' dialog that will fill the parameter(s)?MUST yield a result set of at least one record.?I thought I was doing this, but my DB utility and CF where configured to look at 2 different DBs.?Same structure, but I was pulling IDs from one DB that of course did not yield a result set in the other, in which case FB4 cannot help.

Beginners onward!

I described the solution to the problem in the last post.

No comments:

Post a Comment