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# $Id: LOCAL.pm,v 1.3 2004/11/14 19:30:50 byrnereese Exp $ 8# 9# ====================================================================== 10 11package SOAP::Transport::LOCAL; 12 13use strict; 14use vars qw($VERSION); 15#$VERSION = sprintf("%d.%s", map {s/_//g; $_} q$Name: $ =~ /-(\d+)_([\d_]+)/); 16$VERSION = $SOAP::Lite::VERSION; 17 18# ====================================================================== 19 20package SOAP::Transport::LOCAL::Client; 21 22use vars qw(@ISA); 23@ISA = qw(SOAP::Client SOAP::Server); 24 25sub new { 26 my $self = shift; 27 28 unless (ref $self) { 29 my $class = ref($self) || $self; 30 my(@params, @methods); 31 while (@_) { $class->can($_[0]) ? push(@methods, shift() => shift) : push(@params, shift) } 32 $self = $class->SUPER::new(@params); 33 $self->is_success(1); # it's difficult to fail in this module 34 $self->dispatch_to(@INC); 35 while (@methods) { my($method, $params) = splice(@methods,0,2); 36 $self->$method(ref $params eq 'ARRAY' ? @$params : $params) 37 } 38 } 39 return $self; 40} 41 42sub send_receive { 43 my($self, %parameters) = @_; 44 my($envelope, $endpoint, $action) = 45 @parameters{qw(envelope endpoint action)}; 46 47 SOAP::Trace::debug($envelope); 48 my $response = $self->SUPER::handle($envelope); 49 SOAP::Trace::debug($response); 50 51 $response; 52} 53 54# ====================================================================== 55 561; 57 58__END__ 59