XMLRPC question

Leland Vandervort leland at DEV.DISCPRO.ORG
Fri Oct 22 01:07:32 EDT 2010


Hi Andre, 

Nah.. Frontier is one of the [XML]RPC libraries available for perl in CPAN.
For client side applications it's much simpler to use than the standard
RPC::XML::Client library because it handles the mapping of the data
structures back into hashrefs and dynamically types them, whereas the
standard RPC::XML::Client needs a bit more wrap around it to do effective
typing (bool, int, string, etc.) and hashref mapping.  I don't use Frontier
for server-side though because it doesn't serialise correctly for the
complex recursive/embedded data structures that I often need -- for server
side I use RPC::XML::Server.

As for multidimensional arrays (hashes), all I can say is WIN WIN WIN.  I
use these extensively in Perl, C# (under the guise of Dictionary<>, or
simply multiple declared structures) and C++/Qt (under the guise of
Qmap<Qvariant,..>).

I'm still trying to get to grips with Rev/LiveCode since as you can probably
tell, being used to object-oriented algorithmic languages (Perl, C++, C#,
etc) it's a completely different mindset when moving to a very high level,
almost natural, language... As Yoda said .. "you must unlearn what you have
learned"... Fine for a 900 year old muppet ... LOL

My primary use of Rev/LiveCode is prototyping, especially for cross
platform, but if it's something that in the end is robust, quick, and still
cross-platform, then I can simply deploy with Rev and be done with it :)
(Plus, I am interested in the mobile application deployment options as
well...)

Regards, 

Leland




Le 21/10/2010 23:39, « Andre Garzia » <andre at andregarzia.com> a écrit :

> Hello There Leland,
> 
> Be welcome. Are you calling Userland Frontier server with that XML-RPC code?
> 
> Well, let my curiosity be put aside and let us get back to business. Our
> XML-RPC library is barebones, it works but it is basically some convenient
> methods wrapping our XML generation library. Mind you that some time ago,
> LiveCode (then known as Revolution) had no multidimensional arrays, so
> building structs and more complex objects was not trivial since we could not
> match them to some of our data types.
> 
> Now LiveCode has multidimensional arrays which are not actually arrays but
> hash tables. So we could map back and forth complex structs/arrays with ease
> but no one bothered to write those routines. I bet people here have their
> own home cooked solution.
> 
> I built in dozens of lines a routine to pick an array (LiveCode one) and
> build a struct out of it. Works well and is used internally for testing on
> the company I work for. I haven't build the reverse routine to pick from
> XML-RPC response and decode it back to something addressable.
> 
> Mind you that building that routine is not actually difficult, it is just
> tedious and error prone but it is simple. These days I am somewhat busy but
> as soon as I have free time, I will address this problem. In the mean while,
> I suggest that you use a combination of XML-RPC and XML routines to extract
> your data. You can make it generic enough so that you can feed it any
> XML-RPC response and get an array back, the trick is the iteration routine
> to recursively extract arrays and structs from inside arrays and structs.
> 
> So making a summary, right now, you don't have fancy routines for making an
> XML-RPC a nice object if the response contains complex structures but you
> have helper XML and XML-RPC methods that make building such function an
> approachable task that can be finished in couple hours.
> 
> sorry for not being more helpful right now.
> 
> andre
> PS: I am somewhat disornganized with my projects, there might be the case
> that I've built this function in the past and forgot about it. Will check
> out.
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution




More information about the use-livecode mailing list