in reply to Re: SOAP::Lite server - returning non-SOAP values in sub
in thread SOAP::Lite server - returning non-SOAP values in sub

Hi, What I want is that the caller to wrap the return values in soap tags, so that i don't have to add logic in the subs themselves. In this way I can call existing subs without altering them. Of course I need some way to "name" the return values, but I thought that this maybe is possible?

I guess I could wrap the subs up manually, using a "mysub_soap", whose only mission is to call mysub, wrap the return from mysub in tags, and return it.
  • Comment on Re^2: SOAP::Lite server - returning non-SOAP values in sub

Replies are listed 'Best First'.
Re^3: SOAP::Lite server - returning non-SOAP values in sub
by Anonymous Monk on Aug 26, 2011 at 10:05 UTC
    Its called a subclass, also, a serializer

    one way with Autoloading

    ->dispatch_to('MyModule::SOAPIFY'); ... package MyModule::SOAPIFY; @ISA = qw[ MyModule ]; sub thisMethodNeedsSpecificWrapping { ... } sub AUTOLOAD { ... GenericWrapper... }