line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package CAM::SOAPApp::Std; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
=head1 NAME |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
CAM::SOAPApp::Std - Clotho standard SOAP tools |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
=head1 LICENSE |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
Copyright 2005 Clotho Advanced Media, Inc., |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or modify it |
12
|
|
|
|
|
|
|
under the same terms as Perl itself. |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
=head1 SYNOPSIS |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
Use this just as you would use CAM::SOAPApp. |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
=head1 DESCRIPTION |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
CAM::SOAPApp::Std adds Clotho conventions to CAM::SOAPApp. This |
21
|
|
|
|
|
|
|
includes an omnipresent requestID and auto-detection of |
22
|
|
|
|
|
|
|
request/response wrappers. Those wrappers are handy when working with |
23
|
|
|
|
|
|
|
non-Perl SOAP implementations that can't support receiving unordered |
24
|
|
|
|
|
|
|
arguments or returning multiple values, like Apache Axis for Java. |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
=cut |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
#--------------------------------# |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
require 5.005_62; |
31
|
1
|
|
|
1
|
|
24622
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
38
|
|
32
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
108
|
|
|
1
|
|
|
|
|
45
|
|
33
|
1
|
|
|
1
|
|
372
|
use CAM::SOAPApp; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
our @ISA = qw(CAM::SOAPApp); |
36
|
|
|
|
|
|
|
our $VERSION = '1.03'; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
#--------------------------------# |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=head1 METHODS |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=over 4 |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=cut |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
#--------------------------------# |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=item new ... |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
Adds auto-detection of a C wrapper in the incoming data. |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=cut |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
sub new |
55
|
|
|
|
|
|
|
{ |
56
|
|
|
|
|
|
|
my $pkg = shift; |
57
|
|
|
|
|
|
|
my $self = $pkg->SUPER::new(@_); |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
my %args = $self->SUPER::getSOAPData(); |
60
|
|
|
|
|
|
|
if ($args{request} && ref $args{request}) |
61
|
|
|
|
|
|
|
{ |
62
|
|
|
|
|
|
|
$self->{wrapresponse} = 1; |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
return $self; |
66
|
|
|
|
|
|
|
} |
67
|
|
|
|
|
|
|
#--------------------------------# |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=item getSOAPData |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
Adds unwrapping of C tag, if present. |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=cut |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
sub getSOAPData |
76
|
|
|
|
|
|
|
{ |
77
|
|
|
|
|
|
|
my $self = shift; |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
my %args = $self->SUPER::getSOAPData(); |
80
|
|
|
|
|
|
|
if ($args{request} && ref $args{request}) |
81
|
|
|
|
|
|
|
{ |
82
|
|
|
|
|
|
|
%args = (%args, %{$args{request}}); |
83
|
|
|
|
|
|
|
} |
84
|
|
|
|
|
|
|
return (%args); |
85
|
|
|
|
|
|
|
} |
86
|
|
|
|
|
|
|
#--------------------------------# |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=item response KEY => VALUE, KEY => VALUE, ... |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
Adds an implicit C $input{requestID}> to the parameter |
91
|
|
|
|
|
|
|
list. Also adds wrapping of response in a C tag, if |
92
|
|
|
|
|
|
|
applicable. |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
=cut |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
sub response |
97
|
|
|
|
|
|
|
{ |
98
|
|
|
|
|
|
|
my $self = shift; |
99
|
|
|
|
|
|
|
my $reqID = ($self->{wrapresponse} ? |
100
|
|
|
|
|
|
|
$self->{soapdata}->{request}->{requestID} : |
101
|
|
|
|
|
|
|
$self->{soapdata}->{requestID}); |
102
|
|
|
|
|
|
|
my %response = (@_, requestID => $reqID); |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
if ($self->{wrapresponse}) |
105
|
|
|
|
|
|
|
{ |
106
|
|
|
|
|
|
|
return $self->SUPER::response(response => \%response); |
107
|
|
|
|
|
|
|
} |
108
|
|
|
|
|
|
|
else |
109
|
|
|
|
|
|
|
{ |
110
|
|
|
|
|
|
|
return $self->SUPER::response(%response); |
111
|
|
|
|
|
|
|
} |
112
|
|
|
|
|
|
|
} |
113
|
|
|
|
|
|
|
#--------------------------------# |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
=item error |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
=item error FAULTCODE |
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
=item error FAULTCODE, FAULTSTRING |
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
=item error FAULTCODE, FAULTSTRING, KEY => VALUE, KEY => VALUE, ... |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
Adds an implicit C $input{requestID}> to the fault detail |
124
|
|
|
|
|
|
|
parameter list. |
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
=cut |
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
sub error |
129
|
|
|
|
|
|
|
{ |
130
|
|
|
|
|
|
|
my $self = shift; |
131
|
|
|
|
|
|
|
my $code = shift; |
132
|
|
|
|
|
|
|
my $string = shift; |
133
|
|
|
|
|
|
|
my $reqID = (ref($self) ? |
134
|
|
|
|
|
|
|
($self->{wrapresponse} ? |
135
|
|
|
|
|
|
|
$self->{soapdata}->{request}->{requestID} : |
136
|
|
|
|
|
|
|
$self->{soapdata}->{requestID}) : |
137
|
|
|
|
|
|
|
undef); |
138
|
|
|
|
|
|
|
$self->SUPER::error($code, $string, @_, |
139
|
|
|
|
|
|
|
($reqID ? (requestID => $reqID) : ())); |
140
|
|
|
|
|
|
|
} |
141
|
|
|
|
|
|
|
#--------------------------------# |
142
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
1; |
144
|
|
|
|
|
|
|
__END__ |