Loading ...
Sorry, an error occurred while loading the content.

RE: [soaplite] autobind and PingPong

Expand Messages
  • Paul Kulchenko
    Hi Mark, ... That s where you re loosing me. I m not sure what you mean by last attribute . Let s walk through the code to make it clear. my $p =
    Message 1 of 5 , Nov 18, 2002
    • 0 Attachment
      Hi Mark,

      > PingPong returns no values, yet it prints the last attribute of the
      > object - why the laste attribute and not the object itself? If the
      That's where you're loosing me. I'm not sure what you mean by "last
      attribute". Let's walk through the code to make it clear.

      my $p = My::PingPong->new(10); # local

      static method (class method) of My::PingPong class is called and new
      object is returned (_num property of it is equal 10)

      print 'remote: ', $p->SOAP::next, "\n"; # remote

      object method of the created object is called (SOAP:: prefix tells
      SOAP::Lite to dispatch that method remotely even if My::PingPong
      class exists locally); method returns the *current* value (postfix
      increment is used) AND *magically* returns updated object (the same
      effect that you would expect when invoked locally; works only with
      SOAP::Lite server). "10" should be printed and "11" should be stored
      in updated object ($p).

      print 'local: ', $p->next, "\n"; # local

      Exactly the same thing happens here, only the method is invoked

      print 'remote: ', $p->SOAP::value, "\n"; # remote

      The current value of the _num property is printed. Object is
      transferred remotely, and the value is returned back. Should print
      "12" (number was incremented twice).

      Hope it makes it a little bit more clear.

      Best wishes, Paul.

      --- Mark Proctor <M.Proctor@...> wrote:
      > Yeah sorry that is just me cutting and pasting from my application
      > I'm
      > playing with, was messing around with remote and local method
      > invocation
      > - pasted the wrong one.
      > My understand of perl is he following:
      > If you print an "object" it displays the objects name plus a
      > reference
      > number.
      > If you print an object that invokes a method that returns a value -
      > it
      > prints the value - If that value was nothing, it would print
      > nothing.
      > PingPong returns no values, yet it prints the last attribute of the
      > object - why the laste attribute and not the object itself? If the
      > object isn't a real object and is just a hash simulating an object,
      > then
      > it would print all values.
      > I'll step through the code and start to look over some of soaplite
      > - to
      > see if I can understand what is happening and see where I'm getting
      > confused.
      > Mark
      > -----Original Message-----
      > From: Duncan Cameron [mailto:dcameron@...]
      > Sent: 15 November 2002 12:42
      > To: M_Proctor; soaplite@yahoogroups.com
      > Subject: Re: [soaplite] autobind and PingPong
      > On 2002-11-15 M_Proctor wrote:
      > >In the ping pong example I'm trying to understand what exactly is
      > >being printed when you do :
      > >print 'local: ', $p->SOAP::next, "\n"; # local
      > That line doesn't match my copy of pingpong.pl. It should be:
      > print 'local: ', $p->next, "\n"; # local
      > >
      > >The next method doesn't return any values, but prints the _num
      > >attribute, before it is incremented:
      > >sub next {
      > > my $self = shift;
      > > $self->{_num}++;
      > >}
      > ??? next() *is* returning a value.
      > >
      > >Anyone able to clarify exactly what is happening here?
      > Not sure whether you're stumbling over basic Perl coding or
      > SOAP::Lite.
      > I suggest running under debug and stepping through the code to see
      > and understand what's going on.
      > Also useful is seeing a trace of the SOAP packets. If you are using
      > Windows then get tcptrace, http://www.pocketsoap.com
      > Regards,
      > Duncan Cameron
      > ------------------------ Yahoo! Groups Sponsor
      > To unsubscribe from this group, send an email to:
      > soaplite-unsubscribe@yahoogroups.com
      > Your use of Yahoo! Groups is subject to
      > http://docs.yahoo.com/info/terms/

      Do you Yahoo!?
      Yahoo! Web Hosting - Let the expert host your site
    Your message has been successfully submitted and would be delivered to recipients shortly.