sub soap_response_body { my ($soap_data) = @_; return Akar::SOAP::Data::ResponseBody->new_data($soap_data); } package Akar::SOAP::Data::ResponseBody; .... my $orig_envelope_sub = \&SOAP::Serializer::envelope; no warnings 'redefine'; *SOAP::Serializer::envelope = sub { # if the only value returned is xml data then # method name (parameter 2) is removed from the parameter list if ( $_[1] eq 'response' && UNIVERSAL::isa( $_[3], __PACKAGE__ ) && @_ == 4 ) { splice( @_, 2, 1); } goto $orig_envelope_sub; };