> SO what I need to know is;
> Should the loginservice only return the is authenticated value (a
> single property) - and then I can requery from within the application
> proper for all other attributes required?
Remember that the remote call uses web services, so structs and arrays will pose no problem. We have talked about a plugin to support CF typed objects over a remote call, but I'd like people to think of services normally being as platform-neutral as possible (think of the Yahoo APIs for example).
Robin
Another way I believe you can successfully pass a CFC back from Galaxy
is to define a <CFPROPERTY> tag in your remote galaxy CFC that
references the CFC you wish to return.
For example in your LoginService.cfc, just add the following
<cfproperty name="user" type="path.to.user.cfc">
The purposes this serves is to explicitly inform ColdFusion to include
the definition of your User.cfc within the WSDL that it generates for
LoginService.cfc. If you don't in the Web Service call ColdFusion would
return a typed object that isn't defined in the WSDL and the calling
service wouldn't be able to understand it - which is the situation
you've come across. (fyi - The name="user" is just a placeholder here)
In a non-galaxy CFC you would specify the user.cfc as a returntype on
your remote method to achieve the same result, however as Galaxy only
exposes a single remote method send() you need to explicitly list it here.
Now, when you call the remote Galaxy service you should be able to
successfully get the User object back to the calling ColdFusion code.
Be aware that only the public properties that have been defined with a
<cfproperty> within User.cfc will be returned by ColdFusion
However, the important thing to recognise now is that the User object
you get back to your calling code is a User Java object not a User CFC
object. This means that you'd need to convert that back to a CFC if you
wanted to user the actual methods on the CFC.
But this same conversion would also be required if you serialised the
object to a Plain-Old struct as per Robin's example.
However, in both cases, if you just wanted to use the returned object as
a pure value-object (i.e. just referencing the properties on the object,
and not relying on any methods) then with either method no further
conversion is necessary.
If you are interested, i've got some code that converts a returned Java
CFC back into a regular ColdFusion CFC - it's quite simple, and i think
would actually make a nice optional plug-in into Galaxy at some time in
the future.
I hope you can follow that - shout out if i just confused your further.
Phil