I don't have a ton of experience with web services, but I would think 
the answer is no. Web services generally return string representations 
of data, either in the form of XML or JSON. You could use something like 
cfajaxproxy to create a js proxy object to a cfc, but even then you 
would need to be careful in how your cfc is crafted, and what methods 
are set for remote access, managing security, etc.

Steve "Cutter" Blades
Adobe Certified Professional
Advanced Macromedia ColdFusion MX 7 Developer

Co-Author of "Learning Ext JS"
http://www.packtpub.com/learning-ext-js/book
_____________________________
http://blog.cutterscrossing.com



Ian Skinner wrote:
> I am experimenting to see if it is possible for a ColdFusion web service 
> method to somehow return another object of some sort.  I am not having 
> any luck with either my code or searching Google, but I wanted to ask 
> before I gave this up as impossible.
>
>   My last experiment looked something like this:
>
> *webservice-test.cfm*
>
> <cfset testObj = createObject("component","webservice")>
>
> |<cfoutput>#testObj.getID()#</cfoutput><hr />
> <cfoutput>#testObj.getObj().myFunction("george")#</cfoutput><hr />
> <cfdump var="#testObj.getObj()#"><hr />
> <cfdump var="#testObj#">
>
> <cfset testWS = 
> createObject("webservice","http://localhost/webservice.cfc?wsdl";)>
>
> <cfoutput>#testWS.getID()#</cfoutput><hr />
> <cfdump var="#testWS.getObj()#"><hr />
> <cfdump var="#testWS#">
> |
>
> *webservice.cfc*
>
> |<cfcomponent>
>      <cfproperty name="ID" default="10" type="numeric">
>    <cfproperty name="obj" type="webservice2">
>
>    <cfset variables.ID = "12">
>    <cfset variables.obj = createObject("component","webservice2")>
>
>    <cffunction name="getID" access="remote" returntype="numeric">
>        <cfreturn variables.ID>
>    </cffunction>
>
>    <cffunction name="getObj" access="remote" returntype="webservice2">
>        <cfreturn variables.obj>
>    </cffunction>
> </cfcomponent>
> |
>
> *webservice2.cfc*
>
> |<cfcomponent>
>      <cffunction name="myFunction" access="remote" returntype="string">
>          <cfargument name="myArgument" type="string" required="yes">
>          <cfset myResult=arguments.myArgument>
>          <cfreturn myResult>
>      </cffunction>
> </cfcomponent>
> |
>
> The top portion of the code that access the nested components locally 
> works exactly as expected.
>
> The lower portion of the first file that accesses the nested components 
> as a web service produce an empty string for the method that is supposed 
> to reference the second cfc file.  Is that what happens if one tries to 
> nest objects in a web service, or am I doing something wrong.
>
>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:329443
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to