1 person found this helpful
the cgi script can process more than one lookup in a single HTTP request. that function isn't used by VideoPhoneLabs.
the result is also structured so that there could be multiple identities/peerIDs for each friend, but that case isn't supported by the database schema (m_username is a primary key, meaning entries are unique), nor by VideoPhoneLabs.
finally, lookups are done case-insensitive, but friend names are stored case-preserving. for each friend, for each identity, if the case of the lookup request doesn't match what was stored in the database (during the register phase), then there's an extra "<registered>" tag that returns the exact username registered (including capitalization).
a Flex HTTPService by default interprets the results of a query as XML and parses it into an Object. so, for s:HTTPService:
var httpResult:Object = s.result;
var result:Object = httpResult.result;
var updated:Boolean = result.update; // only present if you attempted a registration
var friend:Object = result.friend as Object; // only if you attempted a lookup
var user:String = friend.user;
var identity:String = friend.identity; // the peerID
var registeredUser:String = friend.hasOwnProperty("registered") ? friend.registered : user;
Michael, thank you for that. I'm in the process of retrofitting it to a .net service (hence my statement about structured dataset return format). The non-used stuff was throwing me, well so did the multi uses of same result elements, but I'm now getting there and your input will definitely help me.