[Maypole] SOAP or XML::RPC

Brian Glass brian@glassbrian.com
Wed, 18 Aug 2004 09:32:29 -0400


I'm a relative Maypole newbie and I'm trying to plan for the future. I 
know that in the future I would like to be able to make calls to my 
application from Mambo CMS (PHP based) via SOAP or XML::RPC. I want to 
make sure that what I am putting together right now will be able to grow 
into that with ease. And in fact, it has been hinted at on the Maypole 
site that a SOAP interface may eventually appear.

In a Maypole view class I am able to call methods which are 
automatically created by has_a or has_many relationships. e.g.:

    [% item.address.city %]

In this example the "item" (assume it's a person) has_a address which 
has a city. In reality Class::DBI is going to do all the work here and 
make some SQL queries on our database and return the information - all 
transparent for me.

If this was done with SOAP what would happen? The Template Toolkit 
and/or Mason (which is actually what I'm using) is relatively tightly 
coupled to the model class. If I was making a remote procedure call what 
would happen? Would the "address" method of the "item" object 
automatically make a SOAP call to the backend? And if it did, would all 
the automatically generated methods be :Exported?  Or would the entire 
object including has_a relationships (with possibly circular references) 
be serialized and sent over the wire?

Would it be a good idea to package up all needed information into a 
simplified object to be serialized right in my model class, or should I 
keep making calls like the above example?

Does that make any sense at all?