Hi,
I’m trying to call a webservice with the following code
and expect to dump a list of country but when I try to dump it I am
getting the following methods.
<cfscript>
ws = createObject("webservice", "
http://sandbox.voxbone.com/ws/services/VoxService?wsdl");
myReturnVar = ws.getCountriesList(args);
</cfscript>
<cfoutput># myReturnVar.ctry#</cfoutput>
<cfdump var="# myReturnVar#">
1st DUMP:
voxbone.webservices.services.containers.ArrayOfCountry@94185581
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)
notify (returns void)
notifyAll (returns void)
toString (returns java.lang.String)
On my 1st DUMP, I can see two (2) getCountry() methods and
tried the following code and do a 2nd DUMP if I can display the
data I want but when I tried to dump it I am getting another
hierarchy of methods ( please see below 2nd DUMP). Now the error
comes when I try to dump getCountryName() method to display country
name for example but it gives me function not found. Can someone
help me what is the correct way of displaying data from a web
service result? Thank you and really appreciate any input.
<cfscript>
ws = createObject("webservice", "
http://sandbox.voxbone.com/ws/services/VoxService?wsdl");
myReturnVar = ws.getCountriesList(args);
realStruct = structNew();
realStruct.ctry = myReturnVar.getCountry();
</cfscript>
<cfoutput>#realStruct.ctry#</cfoutput>
<cfdump var="#realStruct.ctry#">
2nd DUMP:
Lvoxbone.webservices.services.containers.Country;@11e3923
array
1 object of voxbone.webservices.services.containers.Country
Methods hashCode (returns int)
equals (returns boolean)
getSerializer (returns interface
org.apache.axis.encoding.Serializer)
getDeserializer (returns interface
org.apache.axis.encoding.Deserializer)
getTypeDesc (returns org.apache.axis.description.TypeDesc)
getAvailableDidsCount (returns int)
setAvailableDidsCount (returns void)
getCountryCodeA2 (returns java.lang.String)
setCountryCodeA2 (returns void)
getCountryName (returns java.lang.String)
setCountryName (returns void)
getCountryPhoneCode (returns int)
setCountryPhoneCode (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)