Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: (jeffa) Re: SOAP::Lite dispatch routine

by gildir (Pilgrim)
on Jan 04, 2002 at 13:51 UTC ( [id://136240]=note: print w/replies, xml ) Need Help??


in reply to (jeffa) Re: SOAP::Lite dispatch routine
in thread SOAP::Lite dispatch routine

Yes and No,

Yes, Perl objects are just a blessed references, but they may have inner objects which in turn may have other inner objects .. which may have xsub references in them or even open file descriptors. And that is a kind of my case. Every persistent object ($object) has in it a reference to its storage object. And that storage object includes an open (and bound) handle to LDAP storage.

And No, your example will not work in any elegant way if you want to modify an object. Look at an example.

use strict; use SOAP::Lite; use Data::Dumper; my $soap = SOAP::Lite ->uri("http://127.0.0.1/Factory") ->proxy("http://127.0.0.1/mod_soap"); my $object = $soap->instantiate('My::User','5')->result; print Dumper $object; #$VAR1 = bless( { # 'artist' => 'Van Halen', # 'title' => 'You Really Got Me', # 'id' => '5', # 'year' => '1999' hmm, aparently wrong # }, 'My::User' ); $object->year(1978); # modify the year # aaaagrh, it does not work!
I have fetched $object by use of instantiate() method as you suggested. But as the object is just a plain hash, it has no connection with original object on server. Modification of this object will no modify server-side object. Too bad. No persistence.

What I'm trying to achieve is to get a 'proxy object' or a 'remote reference' on the SOAP client side. Something that I call $object->year(2002), it will call year() method on the original server-side object. This is more like CORBA IORs work.

Passing object by reference, not by value.

Replies are listed 'Best First'.
Re: Re: (jeffa) Re: SOAP::Lite dispatch routine
by lachoy (Parson) on Jan 05, 2002 at 01:40 UTC

    IIRC, SOAP doesn't act like CORBA by design, but you can fake it if you like. Like jeffa said, you should be able to pass the modified object back with a command to save it. The SOAP process acting as a proxy could have remembered the object when you requested it and when you pass it back for modification, save that particular object. It's not as elegant or clean as CORBA, but it's not as hairy or expensive either.

    Chris
    M-x auto-bs-mode

(jeffa) 3Re: SOAP::Lite dispatch routine
by jeffa (Bishop) on Jan 04, 2002 at 22:03 UTC
    I was waiting for you to take the bait ;).

    You can't do that with SOAP. You will have to pass the object back to the server if you want to modify it.

    Think about it. Looks like you need a COM/DCOM/CORBA solution, because SOAP don't do that. It's Simple Object Access PROTOCOL, not PERSISTANCE. It IS procedural RPC, just made easier.

    Have you looked into SPOPS yet?

    jeffa

    L-LL-L--L-LL-L--L-LL-L--
    -R--R-RR-R--R-RR-R--R-RR
    F--F--F--F--F--F--F--F--
    (the triplet paradiddle)
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://136240]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (2)
As of 2024-04-26 04:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found