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

Re: [soaplite] soaplite subroutine parameters

Expand Messages
  • Duncan Cameron
    ... Try printing its value! Your server functions are always invoked as methods using Perl s standard O-O idiom. The $class variable will either be the
    Message 1 of 3 , Dec 27, 2002
    • 0 Attachment
      On 2002-12-26 H G <zouko wrote:
      >I'm new to soaplite and I have a basic question about the interaction between
      >servers and clients using it.
      >
      >I noticed in some code that when you call a function from a client and pass a
      >parameter to it, the subroutine will expect two parameters. Eg.:
      >
      >Client:
      >$soap->func($xml);
      >
      >Server: inside sub func
      >
      >my ($class, $xml) = _@;
      >
      >Another example is:
      >
      >$soap->add($var1, $var2);
      >
      >Server:
      >sub add { $_[1] + $_[2]; }
      >
      >Will the first variable ($class) contain some hidden variables or is it used for
      >something else? And in the second example what does $_[0] contain?
      >
      Try printing its value! Your server 'functions' are always invoked
      as 'methods' using Perl's standard O-O idiom.

      The $class variable will either be the class name (you don't
      indicate what your class actually is) or be an instance of the class
      if you are using objects by reference.
      See the iterator.pl and the PersistentIterator.pm files in
      the examples directory for how that first parameter might be used.

      Regards,
      Duncan Cameron
    Your message has been successfully submitted and would be delivered to recipients shortly.