1# ======================================================================
2#
3# Copyright (C) 2007 Martin Kutter.
4# Part of SOAP-Lite, Copyright (C) 2000-2001 Paul Kulchenko
5#  (paulclinger@yahoo.com)
6# You may distribute/modify this file under the same terms as perl itself.
7#
8# $ID: $
9#
10# ======================================================================
11
12package SOAP::Transport::LOOPBACK;
13use strict;
14
15package SOAP::Transport::LOOPBACK::Client;
16use strict;
17
18use vars qw(@ISA);
19use SOAP::Lite;
20@ISA = qw(SOAP::Client);
21
22sub new {
23    return $_[0] if ref $_[0];
24    return bless {}, $_[0];
25}
26
27sub send_receive {
28    my($self, %parameters) = @_;
29
30    $self->code(200);
31    $self->message('OK');
32    $self->is_success(1);
33    $self->status('200 OK');
34
35    return $parameters{envelope};
36}
37
381;
39
40__END__
41
42=pod
43
44=head1 NAME
45
46SOAP::Transport::LOOPBACK - Test loopback transport backend (Client only)
47
48=head1 DESCRIPTION
49
50SOAP::Transport::LOOPBACK is a test transport backend for SOAP::Lite.
51
52It just returns the XML request as response, thus allowing to test the
53complete application stack of client applications from the front end down to
54the transport layer without actually sending data over the wire.
55
56Using this transport backend is triggered by setting a loopback:// URL.
57
58Sending requests through this transport backend alway succeeds with the
59following states:
60
61 status: 200 OK
62 code: 200
63 message: OK
64
65=head1 COPYRIGHT
66
67Copyright (C) 2007 Martin Kutter. All rights reserved.
68
69This file is part of SOAP-Lite, Copyright (C) 2000-2001 Paul Kulchenko.
70
71This library is free software; you can redistribute it and/or modify
72it under the same terms as Perl itself.
73
74=head1 AUTHOR
75
76Martin Kutter E<lt>martin.kutter fen-net.deE<gt>
77
78=cut
79