In the first CFC you set the return type to STRING but
actually returning a QUERY!

<cffunction name="qpAdminFiles" access="remote"
returntype="string"
output="true">
<cfargument name="mySearch" type="string"
required="yes" />
<cfquery name="qpAdminFiles"
datasource="#application.dsn#">
select * from tbl_smartPanel_propInfo
where fld_fileNum like '%#arguments.mySearch#%'
</cfquery>
<cfreturn qpAdminFiles />
</cffunction>


In the second CFC you haven't specified a return type
but returning a QUERY again.

<cffunction name="qpTest" access="remote"
 output="true">
 <cfargument name="mySearch" type="string"
 required="no" />
 <cfquery name="qpTest"
 datasource="#application.dsn#">
 select * from tbl_smartPanel_propInfo_Sale
 where fld_fileNum like '%#arguments.mySearch#%'
 </cfquery>
 <cfreturn qpTest />
 </cffunction>

Note that coldfusion might get you the result when you
dont specify a return type(may be it assumes
returntype="any" if you dont specify one) but for
webservice you should specify one.

Code a new CFC function which will return a STRING and
make sure you could get the output in your flex app.

Mohanraj


--- Jeff Tapper <[EMAIL PROTECTED]> wrote:

> Jeremy -
> 
> Testing as a web service from a cfm page is still
> throwing errors.  Looks 
> like you are missing the return type on the method. 
> Thats required for 
> making cfcs available as a WebService:
> 
> <cfobject
>
webservice="http://flex.homesmartagent.com/wsdl/hs2f.cfc?wsdl";
> 
> name="srv"/>
> <cfset test = srv.qpTest("hi there")>
> <cfdump var="#test#">
> 
> 
> AxisFault
>   faultCode:
>
{http://schemas.xmlsoap.org/soap/envelope/}Server.generalException
>   faultSubcode:
>   faultString: Error attempting to create Java
> skeleton for CFC web 
> service; nested exception is:
>          coldfusion.xml.rpc.CFCInvocationException:
>          [coldfusion.xml.rpc.CFCInvocationException
> : returnType must be 
> defined for remote CFC functions.]
>   faultActor:
>   faultNode:
>   faultDetail:
>         
> {http://xml.apache.org/axis/}hostname:Webserver1
> 
> 
> 
> 
> At 02:01 PM 12/29/2005, you wrote:
> >I removed the function and added this new function.
> I can invoke the
> >cfc correctly with in a cfm page.
> >
> ><cffunction name="qpTest" access="remote"
> output="true">
> ><cfargument name="mySearch" type="string"
> required="no" />
> ><cfquery name="qpTest"
> datasource="#application.dsn#">
> >select * from tbl_smartPanel_propInfo_Sale
> >where fld_fileNum like '%#arguments.mySearch#%'
> ></cfquery>
> ><cfreturn qpTest />
> ></cffunction>
> >
> >--- In flexcoders@yahoogroups.com, Jeff Tapper
> <[EMAIL PROTECTED]> wrote:
> > >
> > > Seems to be a problem in the CFC.  I tried
> calling it from a cfm
> >page and
> > > got an error, which said
> > > Error Executing Database
> Query.][java.sql.SQLException : Table
> > > 'test.tbl_smartPanel_propInfo' doesn't exist]
> > >
> > > My test cfm has only this:
> > > <cfobject
>
>webservice="<http://flex.homesmartagent.com/wsdl/hs2f.cfc?wsdl>http://flex.homesmartagent.com/wsdl/hs2f.cfc?wsdl";
> 
> >
> > > name="srv"/>
> > > <cfset test = srv.qpAdminFiles("hi there")>
> > > <cfdump var="#test#">
> > >
> > >
> > >
> > > At 11:18 AM 12/29/2005, you wrote:
> > > >Ok I will post this again, I have a simple test
> flex app that I am
> > > >using (code below). That connects to a cfc,
> that accpets the incoming
> > > >argument mySearch. The cfc compares the
> argument passed agaist the
> > > >database and then returns a value. However,
> everytime I run this code
> > > >and input a value in the input box and hit
> submit, it comes back
> > > >saying Http Request Error. I have the
> crossdomain in my webroot
> > > >(/var/www/html/) and I also have it in my site
> root
> > > >(/var/www/html/hs2f) and I also have it in my
> cfc root
> > > >(/var/www/html/hs2f/wsdl). I have tried having
> it only in my root,
> > > >root + site root and so on.
> > > >
> > > >Here is my code.
> > > >
> > > >Flex:
> > > >
> > > ><?xml version="1.0" encoding="utf-8"?>
> > > ><mx:Application 
> >
>
xmlns:mx="<http://www.macromedia.com/2005/mxml>http://www.macromedia.com/2005/mxml";
> >xmlns="*">
> > > ><mx:WebService id="srv"
> > >
>
>wsdl="<http://flex.homesmartagent.com/wsdl/hs2f.cfc?wsdl>http://flex.ho
> 
> > mesmartagent.com/wsdl/hs2f.cfc?wsdl"
> > > >showBusyCursor="true" />
> > > ><mx:Script>
> > > ><![CDATA[
> > > >
> > > >function qpAdminFiles(mySearch){
> > > >
> > > >srv.qpAdminFiles(mySearch);}
> > > >]]>
> > > ></mx:Script>
> > > ><mx:states>
> > > ><mx:State name="results">
> > > ><mx:PropertyOverride target="{panel1}"
> property="width" value="100%"/>
> > > ><mx:PropertyOverride target="{panel1}"
> property="height" value="100%"/>
> > > ><mx:AddChild target="{canvas1}"
> position="lastChild">
> > > ><mx:DataGrid x="1" width="100%"
> > > >dataProvider="{srv.qpAdminFiles.result}"
> height="50%" y="85">
> > > ><mx:columns>
> > > ><mx:DataGridColumn headerText="File Number:"
> > > >columnName="FLD_FILENUM"/>
> > > ><mx:DataGridColumn headerText="Archived:"
> columnName="col2"/>
> > > ><mx:DataGridColumn headerText="Last Update:"
> columnName="col3"/>
> > > ></mx:columns>
> > > ></mx:DataGrid>
> > > ></mx:AddChild>
> > > ><mx:PropertyOverride target="{panel1}"
> property="title" value="File
> > > >Search"/>
> > > ></mx:State>
> > > ></mx:states>
> > > ><mx:Panel height="101" width="514" id="panel1"
> title="File Search"
> > > >resizeEffect="Resize">
> > > ><mx:Canvas height="100%" width="100%"
> id="canvas1">
> > > ><mx:Label x="7" y="22" text="File Number:"
> height="20" id="label1"/>
> > > ><mx:TextInput x="85" y="20" toolTip="Partial
> file numbers are ok"
> > > >id="mySearch"/>
> > > ><mx:Button x="250" y="20" label="Find"
> id="button1"
> > >
>
>click="currentState='results';qpAdminFiles(mySearch.text);"/>
> > > ><mx:Button label="Reset" x="304" y="20"
> > > >click="currentState='start'" id="button2"/>
> > > ></mx:Canvas>
> > > ></mx:Panel>
> > > >
> > > ></mx:Application>
> > > >
> > > >
> > > >CFC:
> > > >
> > > ><cffunction name="qpAdminFiles" access="remote"
> returntype="string"
> > > >output="true">
> > > ><cfargument name="mySearch" type="string"
> required="yes" />
> > > ><cfquery name="qpAdminFiles"
> datasource="#application.dsn#">
> > > >select * from tbl_smartPanel_propInfo
> > > >where fld_fileNum like '%#arguments.mySearch#%'
> > > ></cfquery>
> > > ><cfreturn qpAdminFiles />
> > > ></cffunction>
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >--
> > > >Flexcoders Mailing List
> > > >FAQ: 
> >
>
<http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt>http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> > > >Search Archives:
>
><http://www.mail-archive.com/flexcoders%40yahoogroups.com>http://www.mail-archive.com/flexcoders%40yahoogroups.com
> > > >
> > > >
> > > >
> > > >SPONSORED LINKS
> > > >Web site design development Computer software
> development Software
> >design
> > > >and development
> 
=== message truncated ===



                
__________________________________________ 
Yahoo! DSL – Something to write home about. 
Just $16.99/mo. or less. 
dsl.yahoo.com 



------------------------ Yahoo! Groups Sponsor --------------------~--> 
1.2 million kids a year are victims of human trafficking. Stop slavery.
http://us.click.yahoo.com/.QUssC/izNLAA/TtwFAA/nhFolB/TM
--------------------------------------------------------------------~-> 

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to