japhy has asked for the wisdom of the Perl Monks concerning the following question:
My current situation is this. We have two databases: one stores intel (things like addresses, businesses, persons, phone numbers, email addresses, etc.) and one stores folders. A folder is a collection of intel related to ONE particular piece of intel; we might have a folder on Person intel "Jeff Pinyan", and in this folder would have the IDs of the Alias intel "japhy", the URL intel "japhy.perlmonk.org", the Address intel of "... Plainsboro, NJ, 08536, USA", and so on.
When a folder has an item added or removed from it, its update time needs to be changed. Similarly, when a piece of intel in a folder has a note added to it, ITS update time needs to be changed, as well as the folder's update time. Suffice to say, you have to remember to do specific things all the time. I want to use a SOAP server to make it as simple as:
Now. This is my first time using SOAP. Is this the proper idiom? (I realize autodispatch might make this look a whole lot nicer, and I will probably gravitate towards that.) Should I actually HAVE objects on the application end of the code? Or should the application end merely make SOAP calls that play with objects on their own? Should it be as simple as# gets (or creates) the "Person" intel for "Jeff Pinyan" my $japhy_intel = $intelSOAP->call(new => intel_person => "Jeff Pinyan +")->result; # gets (or creates) the folder for Person "Jeff Pinyan" my $japhy_folder = $folderSOAP->call(new => $japhy_intel)->result; # gets (or creates) the "Alias" intel for "japhy" my $alias_intel = $intelSOAP->call(new => intel_alias => "japhy")->res +ult; # adds Alias "japhy" to Person "Jeff Pinyan"'s folder $folderSOAP->add_to_folder($japhy_folder, $alias_intel);
I'll admit, that is far simpler and far more appealing now that I've actually written it. I suppose doing it that way means the application never has to worry about objects at all, since the process is contained on the SOAP server itself. That issue won't entirely go away though, because eventually I'll want to do:$folderSOAP->add_to_folder(intel_person => "Jeff Pinyan", intel_alias +=> "japhy");
or something. I don't know. Like I said, I'm new to this.my @contents = $folderSOAP->get_contents(intel_person => "Jeff Pinyan" +)->result; for (@contents) { print $intelSOAP->display($_)->result; }
And finally, do I need to have
or is there some way for me to get at both services through ONE SOAP::Lite object?my $intelSOAP = SOAP::Lite ->ns("/Platform/Intel") ->proxy("http://localhost:9999/Platform/Intel"); my $folderSOAP = SOAP::Lite ->ns("/Platform/Folder") ->proxy("http://localhost:9999/Platform/Folder");
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: First Forays into SOAP
by samtregar (Abbot) on Jan 20, 2006 at 17:47 UTC | |
|
Re: First Forays into SOAP
by stvn (Monsignor) on Jan 20, 2006 at 21:07 UTC | |
|
Re: First Forays into SOAP
by InfiniteSilence (Curate) on Jan 21, 2006 at 01:56 UTC |