At my company, I'm trying to unify a lot of the code we use. To that end, I'm developing a SOAP server that will provide a simple and standard interface to a lot of our database operations (so that things are done properly).

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:

# 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);
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
$folderSOAP->add_to_folder(intel_person => "Jeff Pinyan", intel_alias +=> "japhy");
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:
my @contents = $folderSOAP->get_contents(intel_person => "Jeff Pinyan" +)->result; for (@contents) { print $intelSOAP->display($_)->result; }
or something. I don't know. Like I said, I'm new to this.

And finally, do I need to have

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");
or is there some way for me to get at both services through ONE SOAP::Lite object?

Jeff japhy Pinyan, P.L., P.M., P.O.D, X.S.: Perl, regex, and perl hacker
How can we ever be the sold short or the cheated, we who for every service have long ago been overpaid? ~~ Meister Eckhart

In reply to First Forays into SOAP by japhy

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.