You can't have optional parameters on web services.

> -----Original Message-----
> From: Burns, John [mailto:[EMAIL PROTECTED]
> Sent: Friday, March 05, 2004 9:26 AM
> To: CF-Talk
> Subject: web services question
>
> Ok, I'm just now starting to use some web services from CFCs and I'm
> running into some problems.  Here's the deal:
>  
> I have a CFC with 1 function in it called "getMembers" and it has 2
> arguments.  1 is required the other is not.  This works fine
> when I call
> it as a CFC, however, when I call it as a web service, I get an error.
> The error just says "LISTID" and says to enable robust
> exception errors.
> I requested that my hosting company turn that on, but in the meantime,
> I'm stuck.  If I remove the arguments and just hardcode those values
> into the CFC, I can call it as a webservice without a problem.  Below
> are code examples:
>  
>  
> MAILINGLIST.CFC
>  
> <cfcomponent>
>  <cffunction name="getMembers" access="remote" returntype="query">
>   <cfargument name="listID" displayname="listID" hint="The listID"
> required="yes" type="numeric" default="4">
>   <cfargument name="memberStatus" displayname="memberStatus" hint="The
> member status" required="no" type="numeric" default="1">
>    <cfquery datasource="global" name="addresses">
>     select MemberEmail as address
>     from EmailListMembers
>     where ListID = #arguments.listID# and MemberStatus =
> #arguments.memberStatus#
>    </cfquery>
>   <cfreturn addresses>
>  </cffunction>
> </cfcomponent>
>  
> -----------------------------------------------------------
> COMPONENTTEST.CFM
>  
> <cfset myObj =
> createObject("component","truth.com.siteManager.mailingList")>
> <cfset MyObj.listID = 4>
> <cfset addresses = myObj.getMembers()>
>  
> <cfdump var="#addresses#">
>  
> ---------------------------------------------------------
> WEBSERVICETEST.CFM
>  
> <cfset myObj =
> createObject("webservice","http://www.truthwebdesign.com/com/s
> iteManager
> /mailingList.cfc?wsdl")>
> <cfset myObj.listID = 4>
> <cfset addresses = myObj.getMembers()>
>  
> <cfdump var="#addresses#">
>  
>  
> Any ideas?  Also, if I try making the 2 arguments not
> required and have
> defaults for them and remove the <cfset myObj.listID = 4>
> line from the
> webservicetest.cfm file, I get an error that says "Web
> service operation
> "getMembers" with parameters {} could not be found."
>  
> Please help.
>  
> John Burns
>
>
>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to