Skip to main content
Inspiring
September 28, 2006
Question

How to display complex type result from web service?

  • September 28, 2006
  • 4 replies
  • 261 views
Hi,

I am trying to invoke a web service with the following code but I can't display the result. Can someone help me how to display the result?

<cfset randomID = CreateUUID()>
<cfset today = Now()>
<cfset args = StructNew()>
<cfset args.login = "wanna">
<cfset args.key = "#DateFormat(today, 'YYYY-MM-DD')# #TimeFormat(today, 'hh:mm:ss')#:#Left(randomID,12)#">
<cfset args.hash= LCase(Hash("123456" & args.key, "SHA"))>

<CFINVOKE webservice=" http://sandbox.voxbone.com/ws/services/VoxService?wsdl"
METHOD="getCountriesList"
AuthenticationToken="#args#"
RETURNVARIABLE="Result">

<cfoutput>#Result#</cfoutput>
This topic has been closed for replies.

4 replies

Inspiring
October 17, 2006
These complex types are a challenge...
It returns a complex type array. You have to invoke the getCountry method to create the array. Try this.

<cfset aCountries = results.getCountry() />
<cfloop index="i" from="1" to="#ArrayLen(aCountries)#>
#aCountry .country#
</cfloop>

I found this link helpful: http://www.webreference.com/programming/coldfusion/1/5.html
EymardAuthor
Inspiring
September 28, 2006
I have tried using that that it display the following. I was expecting a list of coutries but it display the following text only. Can you guide me in displaying list of countries?

"object of voxbone.webservices.services.containers.ArrayOfCountry"


Methods hashCode (returns int)
equals (returns boolean)
getCountry (returns [Lvoxbone.webservices.services.containers.Country;)
getCountry (returns voxbone.webservices.services.containers.Country)
getSerializer (returns interface org.apache.axis.encoding.Serializer)
getDeserializer (returns interface org.apache.axis.encoding.Deserializer)
getTypeDesc (returns org.apache.axis.description.TypeDesc)
setCountry (returns void)
setCountry (returns void)
getClass (returns java.lang.Class)
wait (returns void)
wait (returns void)
wait (returns void)
notify (returns void)
notifyAll (returns void)
toString (returns java.lang.String)
Inspiring
September 28, 2006
<cfoutput>#Result#</cfoutput>

Change this to a cfdump and work from there.
<cfdump var="#result#">
Inspiring
September 28, 2006
<cfoutput>#Result#</cfoutput>