Passing a CFC to a web service

2007-05-10 Thread Esref Atak
Hi,

An error occur, when i pass a component/CFC to a web service:

argument type mismatch

Web service environment is ColdFusion.

My development code below:

cfset Variables.CentralAccountSystem = CreateObject(WebService, 
CentralAccountSystemDevelopment)/
cfset Variables.ClientInfo = CreateObject(component, ClientInfo) /
cfset Variables.Sonuc = 
Variables.CentralAccountSystem.NeedsAnObject(Variables.ClientInfo)/

Web service:

cfcomponent
cffunction name=NeedsAnObject access=remote returntype=numeric
cfargument name=ClientInfo type=ClientInfo required=yes /
cfreturn 1/
/cffunction
/cfcomponent

Development ClientInfo.cfc below:

cfcomponent
cfproperty name=Agent type=string /
cfproperty name=Ip type=string /

cfparam name=this.Agent default=/
cfparam name=this.Ip default=/
/cfcomponent

There are two ClientInfo.cfc. Development (client) and Web Service Server CFC.

How do I pass a CFC to a web service?


~|
ColdFusion MX7 by AdobeĀ®
Dyncamically transform webcontent into Adobe PDF with new ColdFusion MX7. 
Free Trial. http://www.adobe.com/products/coldfusion?sdid=RVJV

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:277581
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Passing a CFC to a web service

2007-05-10 Thread Esref Atak
My problem is resolved. To learn, how i do, follow :)

cfset Variables.CentralAccountSystem = CreateObject(WebService, 
CentralAccountSystemDevelopment)/
cfset Variables.ClientInfo = StructNew() / !--- look this line ---
cfset Variables.Sonuc = 
Variables.CentralAccountSystem.NeedsAnObject(Variables.ClientInfo)/

If a web service wait for an object/CFC, you can pass a structure instead of 
CFC.

~|
Upgrade to Adobe ColdFusion MX7
Experience Flex 2  MX7 integration  create powerful cross-platform RIAs
http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJQ 

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:277602
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4