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

1867Re: [soaplite] Adding methods on the client side?

Expand Messages
  • quinn@fetter.org
    Sep 24, 2002
    • 0 Attachment
      On Mon, Sep 23, 2002 at 07:12:55PM -0700, Paul Kulchenko wrote:

      > Hi Quinn,
      > > One way to achieve this is to cram subroutine references into the
      > > object's namespace at run time:
      > >
      > > Class::method_name = sub { "..." };
      > While it's possible to do the way you described there is no need to
      > do that in most cases. SOAP::Lite supports direct (when you
      > explicitly specify the method name) and indirect invocation (when
      > autodispatch mode is used). In both cases only methods that don't
      > exist locally will be called, but it's possible to override this
      > behaviour using SOAP:: prefix (in which case remote methods will be
      > accessed even if local twins are defined).

      OK, I get it now. All I do is define the client-side methods on the
      client (e.g. by writing and use'ing a module whose package name is the
      name of the class the SOAP service exposes). Then the local code will
      work just as I desired. Ah, much better. :)

      > Still I don't see why you can't do it your way ;)

      Nope, I like this one better... see below.

      > > CPAN module to abstract over this functionality (so you can write
      > > up
      > > your client-side method definitions in a file, use a magic module,
      > > and
      > > have them loaded into the class's name space--maybe at compile
      > > time).
      > I don't think I got this one, so I may be answering the wrong
      > question ;). Could you elaborate?

      Actually, I was just wishing for the functionality you described above,
      where all you have to do is define a module on the client side. I was
      thinking you'd have to do some kind of magic to make that work, but
      evidently you don't. Cool. :)

      I guess this is because autodispatch uses AUTOLOAD, so that SOAP never
      even gets involved unless the method is undefined.

      Thanks for clearing this up, and thanks again for SOAP::Lite. :)
    • Show all 4 messages in this topic