Hi, I tried that and got this error message: The value returned from function userinformation() is not of type struct. Also tried query, and array.
With the string it returns the last value in the struct. aADUserInfo.NUID aADUserInfo.SAMAccountName aADUserInfo.displayName aADUserInfo.email aADUserInfo.firstName aADUserInfo.manager aADUserInfo.lastName aADUserInfo.title aADUserInfo.typeDesc <--returns this -CW
From: "Keith L. Miller" <[EMAIL PROTECTED]> Reply-To: [EMAIL PROTECTED] To: <[EMAIL PROTECTED]> Subject: Re: [CFCDev] display a struct from component Date: Wed, 25 Jun 2003 16:34:12 -0500
Assuming aADUserInfo is your structure then in the line:
<cffunction name="userinformation" access="public" returntype="string" hint="Get user information">
change:
returntype="string" to returntype="struct"
That should do it.
---------------------------------------------------------------------------- ---- Keith L. Miller [EMAIL PROTECTED]
"A good programmer learns from his/her mistakes, but a great programmer learns from the mistakes of others." - Hal Helms "The Power of Antipatterns" ColdFusion Developers Journal Volume: 05 Issue: 05)
----- Original Message ----- From: "chip willis" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, June 25, 2003 4:26 PM Subject: [CFCDev] display a struct from component
> Hi,
> I have two web services in a component and one is working fine, the other
is
> working but I do not know how to return the struct. The web service has a
> structure.
> How do I pass back the struct?
> <cfcomponent>
> <cffunction name="userinformation" access="public" returntype="string"
> hint="Get user information">
> <cfargument name="LogInName" type="string" required="true" hint="the
users
> name">
> <cfinvoke
> webservice="blbla"
> method="getUserInfo"
> returnvariable="aADUserInfo">
> <cfinvokeargument name="username" value="LogInName"/>
> </cfinvoke>
> <cfreturn #aADUserInfo#>
> </cffunction>
> </cfcomponent>
>
> The struct looks like this:
> aADUserInfo.SAMAccountName
> aADUserInfo.displayName
> aADUserInfo.email
> aADUserInfo.firstName
> aADUserInfo.lastName
>
> Here is how I am calling it:
> <cfinvoke
> component="Components\WebServices"
> method="userinformation"
> returnvariable="aADUserInfo">
> <cfinvokeargument name="LogInName" value="#url.username#"/>
> </cfinvoke>
>
> But this output does not work:
> <cfoutput>#aADUserInfo.displayName#</cfoutput>
>
> I do not get an error message but nothing will display. If I run the web
> service outside the component then it works.
> Thanks
> -CW
>
> _________________________________________________________________
> The new MSN 8: smart spam protection and 2 months FREE*
> http://join.msn.com/?page=features/junkmail
>
> ----------------------------------------------------------
> You are subscribed to cfcdev. To unsubscribe, send an email
> to [EMAIL PROTECTED] with the word 'unsubscribe cfcdev'
> in the message of the email.
>
> CFCDev is run by CFCZone (www.cfczone.org) and supported
> by Mindtool, Corporation (www.mindtool.com).
>
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the word 'unsubscribe cfcdev'
in the message of the email.
CFCDev is run by CFCZone (www.cfczone.org) and supported by Mindtool, Corporation (www.mindtool.com).
_________________________________________________________________
STOP MORE SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the word 'unsubscribe cfcdev' in the message of the email.
CFCDev is run by CFCZone (www.cfczone.org) and supported by Mindtool, Corporation (www.mindtool.com).
