Hey All,
OK...I know there is a known bug in CF MX 6.1 about webservices not being able
to see CF mappings....but this is happening on CFMX 7 and seems a tad different:
I have a simple test webservice that creates a query and then calls a local CFC
to convert that query to XML.
here's the code that doesn't work:
<cfcomponent displayname="test" output="false">
<cffunction name="getStuff" access="remote" returntype="string"
output="false">
<cfset MyQuery = QueryNew("col1,col2")>
<!--- add a row to the query --->
<cfset SomeRows = QueryAddRow(MyQuery,1)>
<cfset temp = QuerySetCell(MyQuery,"col1","foo",1)>
<cfset temp = QuerySetCell(MyQuery,"col2","bar",1)>
<cfreturn toString(appcfcs.data_manip.queryToXML(MyQuery,"Table","Rows"))>
</cffunction>
</cfcomponent>
The above code explained:
appcfcs is a CF mapping pointing to D:\wwwroot\cfc
data_manip is the local CFC that is being called and I'm calling the querytoXML
method
The clipped error I'm getting is:
Element DATA_MANIP is undefined in a Java object of type class
[Ljava.lang.String;
So it looks like CF is thinking data_manip is a method when it's actually the
CFC??
here's code that DOES WORK (note I use cfinvoke instead):
<cfcomponent displayname="test" output="false">
<cffunction name="getStuff" access="remote" returntype="string"
output="false">
<cfset MyQuery = QueryNew("col1,col2")>
<!--- add a row to the query --->
<cfset SomeRows = QueryAddRow(MyQuery,1)>
<cfset temp = QuerySetCell(MyQuery,"col1","foo",1)>
<cfset temp = QuerySetCell(MyQuery,"col2","bar",1)>
<cfinvoke component="appcfcs.data_manip" method="queryToXML"
returnvariable="ResultXML">
<cfinvokeargument name="queryObj" value="#MyQuery#">
<cfinvokeargument name="arg1" value="Tables">
<cfinvokeargument name="arg2" value="Rows">
</cfinvoke>
<cfreturn toString(ResultXML)>
</cffunction>
</cfcomponent>
So using cfinoke abviously clears things up....but I'd prefer the shorter form
in the first code example for calling the local CFC
I think my brain is melting and I'm just missing something stupid....anybody??
;-)
TIA
Cheers
Bryan Stevenson B.Comm.
VP & Director of E-Commerce Development
Electric Edge Systems Group Inc.
phone: 250.480.0642
fax: 250.480.1264
cell: 250.920.8830
e-mail: [EMAIL PROTECTED]
web: www.electricedgesystems.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking
application. Start tracking and documenting hours spent on a project or with a
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:215723
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54