| 1 | #********************************************************************* | ||||||||||||||||||||
| 2 | #*** ResourcePool/Command/SOAP/Lite/Call.pm | ||||||||||||||||||||
| 3 | #*** Copyright (c) 2003 by Markus Winand <mws@fatalmind.com> | ||||||||||||||||||||
| 4 | #*** $Id: Call.pm,v 1.5 2011-01-31 13:49:38 mws Exp $ | ||||||||||||||||||||
| 5 | #********************************************************************* | ||||||||||||||||||||
| 6 | package ResourcePool::Command::SOAP::Lite::Call; | ||||||||||||||||||||
| 7 | |||||||||||||||||||||
| 8 | 1 | ▶ | use ResourcePool::Command; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 9 | 1 | ▶ | use ResourcePool::Command::NoFailoverException; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 10 | 1 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 11 | 1 | ▶ | use SOAP::Lite; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 12 | 1 | ▶ | use vars qw(@ISA $VERSION); | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 13 | |||||||||||||||||||||
| 14 | 1 | $VERSION = "1.0103"; | |||||||||||||||||||
| 15 | 1 | push @ISA, qw(ResourcePool::Command); | |||||||||||||||||||
| 16 | |||||||||||||||||||||
| 17 | 1 | ▶ | sub new($$) { | ||||||||||||||||||
|
Subroutine
new: called CC=2 SCAR=7.1
Pod
documented
| |||||||||||||||||||||
| 18 | 1 | my $proto = shift; | |||||||||||||||||||
| 19 | 1 | ▶ | my $class = ref($proto) || $proto; | ||||||||||||||||||
|
Condition33%1/3
ref $proto || $proto
MC/DC0%0/2
ref $proto || $proto
ref $proto
$proto
Truth table33%1/3
A || B
A= ref $protoB= $proto
| |||||||||||||||||||||
| 20 | 1 | my $self = {}; | |||||||||||||||||||
| 21 | 1 | $self->{namespace} = shift; | |||||||||||||||||||
| 22 | |||||||||||||||||||||
| 23 | 1 | bless($self, $class); | |||||||||||||||||||
| 24 | 1 | return $self; | |||||||||||||||||||
| 25 | } | ||||||||||||||||||||
| 26 | |||||||||||||||||||||
| 27 | 4 | ▶ | sub execute($$$@) { | ||||||||||||||||||
|
Subroutine
execute: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||
| 28 | 4 | my ($self, $soaph, $method, @args) = @_; | |||||||||||||||||||
| 29 | |||||||||||||||||||||
| 30 | 4 | $soaph->uri($self->{namespace}); | |||||||||||||||||||
| 31 | 4 | my $som = $soaph->call($method => @args); | |||||||||||||||||||
| 32 | 4 | my $fc = $som->faultcode(); | |||||||||||||||||||
| 33 | 4 | ▶ | if ($fc) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 34 | # some error happend | ||||||||||||||||||||
| 35 | # throw NoFailoverException if it is a Client fault | ||||||||||||||||||||
| 36 | 3 | my $ex; | |||||||||||||||||||
| 37 | 3 | ▶ | if ($fc =~ /^[^:]*:Client/i) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 38 | 1 | $ex = ResourcePool::Command::NoFailoverException->new($som->fault()); | |||||||||||||||||||
| 39 | } else { | ||||||||||||||||||||
| 40 | 2 | $ex = $som->fault(); | |||||||||||||||||||
| 41 | } | ||||||||||||||||||||
| 42 | |||||||||||||||||||||
| 43 | 3 | die $ex; | |||||||||||||||||||
| 44 | } | ||||||||||||||||||||
| 45 | 1 | return $som->result(); | |||||||||||||||||||
| 46 | } | ||||||||||||||||||||
| 47 | |||||||||||||||||||||