On 22 Jul 2003 at 15:22, Steinhilber, Carl wrote:

>    <CFINVOKE 
>    webservice="http://webservices.empowered.com/statsws/stats.asmx?WSDL";
>    method="GetTeams"  returnVariable="arTeamsArray">
>    <CFDUMP var="#arTeamsArray#">
> 
> 
> This returns an object
> ("com.empowered.webservices.StatsWS.DataService.ArrayOfTeams"). But I
> seem to be unable to execute any methods of the object or
> deserialize/use the data any other way.
> 
> Help! 
> I'm really just trying to get my feet wet in SOAP and web services...
> but it seems like I can't even get past step one.
> 
> Any pointers would be greatly appreciated!


>From a bit of experimenting, it appears that GetTeams actually needs 
to be called twice, which might be what's catching you out - that is, 
the GetTeams method of the web service returns an ArrayOfTeams 
object, and you have to call GetTeams on the ArrayOfTeams object to 
get an actual array.

The code I've arrived at is:
   <CFINVOKE  
webservice="http://webservices.empowered.com/statsws/stats.asmx?WSDL";
   method="GetTeams"  returnVariable="arTeamsArray">
<CFDUMP
   var="#arTeamsArray#">

<!--- very simple function call,
  to check that calls are working correctly... --->
<cfset stringForm = arTeamsArray.toString()>
<cfoutput>String representation of the object is: 
#stringForm#</cfoutput>

<!--- get the actual array of Teams objects --->
<cfset teams = arTeamsArray.getTeams()>
<cfdump var="#teams#">

<!--- call getTeamDescription on the first Teams object --->
<cfset firstTeamName = teams[1].getTeamDescription()>

<cfoutput>Name of the first team is: #firstTeamName#</cfoutput>



which gives me
 String representation of the object is: 
[EMAIL PROTECTED]

 Name of the first team is: Anaheim Angels


Hope that's enough to get you started,
- Matthew

-----------------------+
cf-xml mailing list
http://torchbox.com/xml/list.cfm

Reply via email to