SOAP::Transport::LOOPBACK - Test loopback transport backend (Client only)


SOAP-Lite documentation Contained in the SOAP-Lite distribution.

Index


Code Index:

NAME

Top

SOAP::Transport::LOOPBACK - Test loopback transport backend (Client only)

DESCRIPTION

Top

SOAP::Transport::LOOPBACK is a test transport backend for SOAP::Lite.

It just returns the XML request as response, thus allowing to test the complete application stack of client applications from the front end down to the transport layer without actually sending data over the wire.

Using this transport backend is triggered by setting a loopback:// URL.

Sending requests through this transport backend alway succeeds with the following states:

 status: 200 OK
 code: 200
 message: OK 

COPYRIGHT

Top

AUTHOR

Top

Martin Kutter <martin.kutter fen-net.de>


SOAP-Lite documentation Contained in the SOAP-Lite distribution.

# ======================================================================
#
# Copyright (C) 2007 Martin Kutter.
# Part of SOAP-Lite, Copyright (C) 2000-2001 Paul Kulchenko 
#  (paulclinger@yahoo.com)
# You may distribute/modify this file under the same terms as perl itself.
#
# $ID: $
#
# ======================================================================

package SOAP::Transport::LOOPBACK;
use strict;

package SOAP::Transport::LOOPBACK::Client;
use strict;

use vars qw(@ISA);
@ISA = qw(SOAP::Client);

sub new {
    my $class = ref $_[0] || $_[0];
    return bless {}, $class;
}

sub send_receive {
    my($self, %parameters) = @_;
    
    $self->code(200);
    $self->message('OK');
    $self->is_success(1);
    $self->status('200 OK');

    return $parameters{envelope};
}

1;

__END__