Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

[r398]: branches / 0.71 / lib / SOAP / Transport / LOOPBACK.pm Maximize Restore History

Download this file

LOOPBACK.pm    78 lines (52 with data), 1.7 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# ======================================================================
#
# 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 {
return $_[0] if ref $_[0];
return bless {}, $_[0];
}
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__
=pod
=head1 NAME
SOAP::Transport::LOOPBACK - Test loopback transport backend (Client only)
=head1 DESCRIPTION
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
=head1 COPYRIGHT
Copyright (C) 2007 Martin Kutter. All rights reserved.
This file is part of SOAP-Lite, Copyright (C) 2000-2001 Paul Kulchenko.
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.
=head1 AUTHOR
Martin Kutter E<lt>martin.kutter fen-net.deE<gt>
=cut