Fellow monks,

I have recently came up to SOAP::Lite and made som experiment with it, but for a real use i will nett some kind of custom dispatch routine for SOAP::Lite.

What I'm trying to do:
I have a bunch of persistent objects stored in LDAP or RDBMs or wherever. I have a good perl home-brewn module for object persistence. Now I want to 'publish' this interface to other applications using SOAP.
My semantics works like this:

my $object = $factory->instantiate('My::User', id => 'uid=semancik,ou= +people,o=bgs,c=sk'); print $object->realName; # read attribute $object->realName('Radovan Semancik'); # Set attribute
I have tried it this way (mod_perl style):
# server my $server = SOAP::Transport::HTTP::Apache->new; $server->dispatch_with({ 'http://jewels.bgs.sk/Factory' => $factory, }); sub handler { $server->handler(@_) }; # client my $soap = SOAP::Lite ->uri('http://jewels.bgs.sk/Factory') ->proxy('http://jewels.bgs.sk/soap'); my $object = $soap->instantiate('My::User','whateverId')->result;
But alas, $object is just a simple blessed hash. This won't work, because server side objects has open database handles and several non-travsferable attributes. The only way to do this is to make a proxy object and instantiate server side object on every request.

But SOAP is supposed to be Object Access protocol, not procedural RPC ..... so I want to use it the right way.

Well, I have decided to try it another way around. I want to access objects with URI like this: 'http://jewels.bgs.sk/MyUser/whateverId' and have it dispatched the way I like it.
How can I do this in SOAP::Lite? How can I substitute my very own dispatch routine to SOAP server?

Or am I going wrong way from the very beginning?
Any help/suggestion appreciated.


In reply to SOAP::Lite dispatch routine by gildir

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.