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

OO interface - updating the object

Expand Messages
  • mwilkinson@gene.pbi.nrc.ca
    Hi everyone, hopefully this is a straightforward question: In the documentation implementation of OO interface it says that of you want to make a method call
    Message 1 of 2 , Aug 21, 2002
      Hi everyone,

      hopefully this is a straightforward question:

      In the documentation "implementation of OO interface" it says that of
      you want to make a method call that updates the object itself you must:

      $obj = $soap->call(new => @params)->result;
      $soap->call(method => $obj)

      What appears on the server side as the first parameter passed to the
      method? I presume it is $obj, yeah? The same as if you had called
      $obj->method? So efectively the server-side code should be

      sub method {
      my ($self) = @_;
      ...do stuff here to update $self...
      return $self # <- is this necessary??
      }

      That last line... what does that mean in this context? I am updating
      $obj, but do I need to pass it back to the client explicitly, or does
      that happen "automagically"? Should the client code be

      $obj = $soap->call(method => $obj);

      instead?

      Any clarification would be great!

      Cheers,

      M


      --
      --------------------------------
      "Speed is subsittute fo accurancy."
      ________________________________

      Dr. Mark Wilkinson, RA Bioinformatics
      National Research Council, Plant Biotechnology Institute
      110 Gymnasium Place, Saskatoon, SK, Canada

      phone : (306) 975 5279
      pager : (306) 934 2322
      mobile: markw_mobile@...
    • mwilkinson@gene.pbi.nrc.ca
      Nix that question - I just discovered that it is *entirely* automagical... I wonder if this behaviour could be documented a little more thoroughly? It is
      Message 2 of 2 , Aug 21, 2002
        Nix that question - I just discovered that it is *entirely*
        automagical...

        I wonder if this behaviour could be documented a little more
        thoroughly? It is extremely counterintuitive to discover that

        my $return = $self->SOAP_connection->call('retrieveServiceNames' =>
        (@_))->paramsall;

        and

        my $return = $self->SOAP_connection->call('retrieveServiceNames' =>
        ($obj, @_))->paramsall;

        look ~the same on the server-side, except in the latter case the first
        parameter of @_ is the object plus its current data, while the first
        paramter of @_ in the former case does not have any data.

        It took a couple of hours of playing with the debugger to convince
        myself that this was really happening... I like it!! But I think it
        needs to be better documented as it is just a little bit *too* magical
        to believe until you have tested it over and over again! :-)

        cheers Paul!

        M
      Your message has been successfully submitted and would be delivered to recipients shortly.