任何人都知道如何解决这个问题?
"Unable to invoke CFC - The value returned from the getAllContacts function is not of type Contacts[].
如果将组件名称指定为返回类型,则可能找不到或无法访问该组件的定义文件。”
谢谢你。
[更新]
当然可以:这是 ContactsService.cfc 中的代码:
<cfcomponent output="false">
<!--- [irrelevant code removed] --->
<cffunction name="getAllContacts" returntype="Contacts[]" access="remote">
<cfreturn entityload("Contacts") />
</cffunction>
<!--- [irrelevant code removed] --->
Contacts.cfc 中的代码:
<cfcomponent persistent="true" table="Contacts" output="false">
<cfproperty name="id" column="id" type="numeric" ormtype="int" fieldtype="id" />
<cfproperty name="company" column="company" type="string" ormtype="string" />
<cfproperty name="Sub_Heading" column="Sub_Heading" type="string" ormtype="string"/>
<cfproperty name="Department" column="Department" type="numeric" ormtype="int" />
<cfproperty name="boss" column="boss" type="string" ormtype="string" />
<cfproperty name="Room" column="Room" type="string" ormtype="string" />
<cfproperty name="Phone" column="Phone" type="string" ormtype="string" />
</cfcomponent>