>- see footer for list info -< When invoking a cfc as a web service you cannot have optional arguments, they all must be passed, maybe this your issue.
Also is there any reason to not make the original component a remote web site rather than creating another CFC that wraps it ? Russ -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Terry Riley Sent: 02 October 2008 17:32 To: [email protected] Subject: [CF-Dev] CFMX6.1 and web services >- see footer for list info -< Long post warning.... Am a newcomer to web services, but learning fairly quickly. And I cannot move to CF7 or CF8 yet, so I hope the answer doesn't absolutely involve any upgrade! I have created cfcs and relevant functions for others to get data from our server, and have created a number of discrete <cfinvoke>s to pass data back to a particular web service (not CF). If the service is consumed as follows: <cfinvoke webservice = "http://xyz.com/service.php?class=webServices&wsdl" method = "createPlayer" returnvariable = "success" username = 'joe' password = 'pass'> <cfinvokeargument name = "mitoo_player_id" value="#new_player_id#" /> <cfinvokeargument name = "gr_player_firstname" value="#new_player_firstname#" /> <cfinvokeargument name = "gr_player_lastname" value="#new_player_lastname#" /> <cfinvokeargument name = "mitoo_team_ids" value="#new_player_team_ids#" /> </cfinvoke> <cfoutput>#success.success_code#</cfoutput> I have no problems and get back the required success object. However, I want to stick all of these invokes inside a cfc as functions, requesting them as <cfinvoke> with parameters from outside, as and when the need araises (ie trying to reuse some code like the generation of the webservice object) If the params are passed via an invoke such as: <cfinvoke component="gr_webServices" method="createPlayer" returnvariable="gr_player_id"> <cfinvokeargument name="mitoo_player_id" value=#new_player_id# /> <cfinvokeargument name="gr_player_firstname" value=#new_player_firstname# /> <cfinvokeargument name="gr_player_lastname" value=#new_player_lastname# /> <cfinvokeargument name="mitoo_team_ids" value=#new_player_team_ids# /> </cfinvoke> and the component contains: <cfcomponent> <cffunction name="createPlayer" access="public" username="fred" password="bloggs" returntype="numeric" output="no"> <cfargument name="mitoo_player_id" type="numeric" required="true" hint="the latest player added"> <cfargument name="gr_player_firstname" type="string" required="true" hint="the latest player's first name"> <cfargument name="gr_player_lastname" type="string" required="true" hint="the latest player's last name"> <cfargument name="mitoo_team_ids" type="array" required="true" hint="teams the player is signed to"> <cfset var gr_player_id = ''> <cfscript> ws = createObject("webservice","http://xyz.com/service.php?class=webServices&ws dl"); gr_player_id = ws.createPlayer(arguments); return gr_player_id; </cfscript> </cffunction> </cfcomponent> I get yer actual error screen which includes: Web service operation "createPlayer" with parameters {{GR_PLAYER_FIRSTNAME={Terry},GR_PLAYER_LASTNAME={Riley},MITOO_PLAYER_ID={ 1},MITOO_TEAM_IDS={[123]},}} could not be found. Now I've tried to simulate the the invoke in other ways, such as: <cfset gr_webServices = createObject("webservice", "http://xyz.com/service.php?class=webServices&wsdl")> <cfscript> arguments = StructNew(); arguments.mitoo_team_ids = #new_player_team_ids#; arguments.mitoo_player_id = #new_player_id#; arguments.gr_player_firstname = #new_player_firstname#; arguments.gr_player_lastname = #new_player_lastname#; success = gr_webServices.createPlayer(arguments); return success; </cfscript> and I get the same error as above. It looks to me as though the invoke through the cfc (or through the script method above) is creating another empty variable (see the comma before the closing double bracket), but the arguments structure prior to submission (whichever way I do it) contains only the four pairs, not an empty fifth, as shown by using <cfdump>. I've searched the googleverse for an answer, to no avail, so I though I would ask my old gurus if they know the answer. Any help - positive or negative - is welcome. Terry http://www.confexdb.co.uk/ -- No virus found in this outgoing message. Checked by AVG. Version: 7.5.523 / Virus Database: 270.7.5/1702 - Release Date: 01/10/2008 09:05 _______________________________________________ For details on ALL mailing lists and for joining or leaving lists, go to http://list.cfdeveloper.co.uk/mailman/listinfo -- CFDeveloper Sponsors:- >- cfdeveloper Hosting provided by www.cfmxhosting.co.uk -< >- Lists hosted by www.Gradwell.com -< >- CFdeveloper is run by Russ Michaels, feel free to volunteer your help -< _______________________________________________ For details on ALL mailing lists and for joining or leaving lists, go to http://list.cfdeveloper.co.uk/mailman/listinfo -- CFDeveloper Sponsors:- >- cfdeveloper Hosting provided by www.cfmxhosting.co.uk -< >- Lists hosted by www.Gradwell.com -< >- CFdeveloper is run by Russ Michaels, feel free to volunteer your help -<
