1# ======================================================================
2#
3# Copyright (C) 2000-2001 Paul Kulchenko (paulclinger@yahoo.com)
4# SOAP::Lite is free software; you can redistribute it
5# and/or modify it under the same terms as Perl itself.
6#
7# ======================================================================
8
9package SOAP::Transport::LOCAL;
10
11use strict;
12
13
14our $VERSION = 1.11;
15
16# ======================================================================
17
18package SOAP::Transport::LOCAL::Client;
19
20use SOAP::Lite;
21
22use vars qw(@ISA);
23our @ISA = qw(SOAP::Client SOAP::Server);
24
25sub new {
26    my $class = shift;
27    return $class if ref $class;
28    my @method_from;
29    while (@_) {
30        if ($class->can($_[0])) {
31            push(@method_from, shift() => shift);
32        }
33        else
34        {
35            # ignore unknown arguments
36            shift;
37        }
38    }
39    my $self = $class->SUPER::new();
40    $self->is_success(1);     # it's difficult to fail in this module
41    $self->dispatch_to(@INC);
42    while (@method_from) {
43        my($method, $param_ref) = splice(@method_from,0,2);
44        $self->$method(ref $param_ref eq 'ARRAY'
45            ? @$param_ref
46            : $param_ref)
47    }
48    return $self;
49}
50
51sub send_receive {
52    my ($self, %parameters) = @_;
53    my ($envelope, $endpoint, $action) =
54        @parameters{qw(envelope endpoint action)};
55
56    SOAP::Trace::debug($envelope);
57    my $response = $self->SUPER::handle($envelope);
58    SOAP::Trace::debug($response);
59
60    return $response;
61}
62
63# ======================================================================
64
651;
66
67__END__
68