Webservices Question
Hello all,
I am again working with the Angel.com IVR outbound API (I posted here once before about this). This time I need to get the statuses of call that have been placed. They have a function called getStatus() where you simply pass in an array of call identifies, and they give you have info about them. The problem is that I cannot figure out how to access the information, because they give back an array of functions (some of which contain other functions).
They do have sample code for numerous languages. Here is the java sample, since that is closest to Cold Fusion. Here is their code that does what I want.
ocss = oc.getStatus(ocl.getToken(), guids.toArray(new String[0]));
/**
* Print out status information of each call.
*/
for(int i = 0; i < ocss.length; i++) {
CallIDentifier cid = ocss.getCallIDentifier();
for(int j = 0; j < ocss.getStatusItems().length; j++) {
OutboundCallStatusItem ocsi = ocss.getStatusItems();
System.out.println(cid.getOutboundCallGUID() + "|\t\t\t|" +
cid.getPhoneNumber() + "|\t\t\t|" +
ocsi.getMessage() + "|\t\t\t|" +
ocsi.getStatus());
}
}
The line that confuses me there is
OutboundCallStatusItem ocsi = ocss.getStatusItems();
What the hell is that
<cffunction name="GetCallStatus" access="public" hint="Find call statuses for an array of call GUID's">
<cfargument name="outBoundCallGUIDs" type="array" hint="An array of call GUID's" required="yes">
<cfargument name="token" type="string" hint="Login token for the API" required="yes">
<cfset var CallInfo = [] />
<!--- Send the call object to the webservice --->
<cfinvoke webservice="http://www.angel.com/outbound/wsdl/OutboundCallService.wsdl" method="getStatus" returnvariable="ocss">
<cfinvokeargument name="token" value="#arguments.Token#"/>
<cfinvokeargument name="outboundCallGUIDs" value="#arguments.outboundCallGUIDs#"/>
</cfinvoke>
<cfloop from="0" to="#arraylen(ocss.getStatusItems())#" index="j">
<cfset CallInfo["EntireReturnedObject"] = ocss>
<cfset CallInfo["CallGuid"] = cid.getOutboundCallGUID()>
<cfset Callinfo["NumberDialed"] = cid.getPhoneNumber()>
<cfset Callinfo["Object"] = cid>
<cfset Callinfo["ocsi"] = ocss.getStatusItems()>
<!---- Does not work, returns "Invalid CFML construct found on line 248 at column 96."
<cfset CallInfo["GetStatusItems"] = ocss.getStatusItems()>
---->
<!--- Does not work, returns "1 null <br>The error occurred on line 244."
<cfset CallInfo["GetStatusItems"] = ocss.getStatusItems(j)>
---->
<!--- Does nto work, returns "The getMesage method was not found."
<cfset Callinfo["Message"] = ocss.getStatusItems().getMesage()>
----->
</cfloop>
<cfreturn CallInfo>
</cffunction>
But the last <cfset> line in the loop fails. I have no idea how to reference the getStartTime function which is stored in the getStatusItems function.
I am totally stuck, I have tried a million variation on sytax, and I always get errors stating that the getStartTime method cannot be found, even though it does very clearly exist withing the getStatusItems().
You can see my test page here, to see the data that is getting returned.
http://portal.fpitesters.com/ivr/getCallStatus.cfm
You can see their java sample code here
http://www.socialtext.net/ivrwiki/index.cgi?java_sample_code
Here is their whole library on the API, with other sample code languages listed at the bottom of the page, as well as more information on the getStatus function.
http://www.socialtext.net/ivrwiki/index.cgi?java_sample_code
Any help is appreciated. Thank you.
(FYI when i get all this done I do plan on releasing a CFC with all these functions put together so other CF coders can use Angel.com without having to fight through all the crap I am).
