Client/WSQueryInterfaceService.pm untested

filter: Statementstmt 0.0% 0 / 87 Branchbran 0.0% 0 / 24 Conditioncond 0.0% 0 / 15 MC/DCmcdc 0.0% 0 / 10 Subroutinesub 0.0% 0 / 11 Podpod 0.0% 0 / 3 totaltotal 0.0% 0 / 150 CC 11 SCAR 37.0
CC
11
Cov
0%
_call
90.0
BEGIN
6.0
AUTOLOAD
6.0
CRAP 40.5
1 package Astro::SIMBAD::Client::WSQueryInterfaceService;
2 # Generated by SOAP::Lite (v0.69) for Perl -- soaplite.com
3 # Copyright (C) 2000-2006 Paul Kulchenko, Byrne Reese
4 # Portions copyright (C) 2011-2026 by Thomas R. Wyant, III
5 # -- generated at [Thu Aug 31 16:25:31 2006]
6 # -- generated from http://simweb.u-strasbg.fr/axis/services/WSQuery?wsdl
7  
8 ## TRW vvvv
9 use strict;
10 use warnings;
11  
12 our $VERSION = '0.049_01';
13 ## TRW ^^^^
14  
15 my %methods = (
16 queryObjectById => {
17 ## endpoint => 'http://simweb.u-strasbg.fr:8080/axis/services/WSQuery',
18 endpoint => 'axis/services/WSQuery',
19 soapaction => '',
20 namespace => 'http://uif.simbad.cds',
21 parameters => [
22 SOAP::Data->new(name => 'in0', type => 'soapenc:string', attr => {}),
23 SOAP::Data->new(name => 'in1', type => 'soapenc:string', attr => {}),
24 SOAP::Data->new(name => 'in2', type => 'soapenc:string', attr => {}),
25 ], # end parameters
26 }, # end queryObjectById
27 queryObjectByBib => {
28 ## endpoint => 'http://simweb.u-strasbg.fr:8080/axis/services/WSQuery',
29 endpoint => 'axis/services/WSQuery',
30 soapaction => '',
31 namespace => 'http://uif.simbad.cds',
32 parameters => [
33 SOAP::Data->new(name => 'in0', type => 'soapenc:string', attr => {}),
34 SOAP::Data->new(name => 'in1', type => 'soapenc:string', attr => {}),
35 SOAP::Data->new(name => 'in2', type => 'soapenc:string', attr => {}),
36 ], # end parameters
37 }, # end queryObjectByBib
38 queryObjectByCoord => {
39 ## endpoint => 'http://simweb.u-strasbg.fr:8080/axis/services/WSQuery',
40 endpoint => 'axis/services/WSQuery',
41 soapaction => '',
42 namespace => 'http://uif.simbad.cds',
43 parameters => [
44 SOAP::Data->new(name => 'in0', type => 'soapenc:string', attr => {}),
45 SOAP::Data->new(name => 'in1', type => 'soapenc:string', attr => {}),
46 SOAP::Data->new(name => 'in2', type => 'soapenc:string', attr => {}),
47 SOAP::Data->new(name => 'in3', type => 'soapenc:string', attr => {}),
48 ], # end parameters
49 }, # end queryObjectByCoord
50 ); # end my %methods
51  
52 use SOAP::Lite;
53 use Exporter;
54 use Carp ();
55 our @CARP_NOT = qw{SOAP::Lite};
56  
57 use vars qw(@ISA $AUTOLOAD @EXPORT_OK %EXPORT_TAGS);
58 @ISA = qw(Exporter SOAP::Lite);
59 @EXPORT_OK = (keys %methods);
60 %EXPORT_TAGS = ('all' => [@EXPORT_OK]);
61  
62 sub _call {
63 ## TRW vvvv
64 ## my ($self, $method) = (shift, shift);
65 my ($self, $method, $simbad, @parm) = @_;
66 $simbad or Carp::croak 'Astro::SIMBAD::Client object not specified';
67 ## my $name = UNIVERSAL::isa($method => 'SOAP::Data') ? $method->name : $method;
68 my $name = eval {$method->isa('SOAP::Data')} ? $method->name : $method;
69 ## TRW ^^^^
70 my %method = %{$methods{$name}};
71 ## TRW vvvv
72 $method{endpoint} or Carp::croak "No server address (proxy) specified";
73 my $endpoint = $simbad->__build_url( $method{endpoint} );
74 ## $self->proxy($method{endpoint} || Carp::croak "No server address (proxy) specified")
75 $self->proxy( $endpoint )
76 unless $self->proxy;
77 ## TRW ^^^^
78 my @templates = @{$method{parameters}};
79 ## TRW my @parameters = ();
80 my @parameters;
81 ## TRW foreach my $param (@_) {
82 foreach my $param (@parm) { ## TRW
83 if (@templates) {
84 my $template = shift @templates;
85 ## TRW my ($prefix,$typename) = SOAP::Utils::splitqname($template->type);
86 my (undef,$typename) = SOAP::Utils::splitqname($template->type); ## TRW
87 my $method = 'as_'.$typename;
88 # TODO - if can('as_'.$typename) {...}
89 my $result = $self->serializer->$method($param, $template->name, $template->type, $template->attr);
90 push(@parameters, $template->value($result->[2]));
91 } else {
92 push(@parameters, $param);
93 }
94 }
95  
96 ## TRW $self->endpoint($method{endpoint})
97 ## TRW ->ns($method{namespace})
98 ## TRW ->on_action(sub{qq!"$method{soapaction}"!});
99  
100 ## vvv TRW
101  
102 if ($self->can ('ns')) {
103 $self->endpoint($endpoint)
104 ->ns($method{namespace})
105 ->on_action (sub{$method{soapaction}});
106 } else {
107 $self->endpoint($endpoint)
108 ->envprefix ('soap')
109 ->uri($method{namespace})
110 ->on_action (sub{$method{soapaction}});
111 }
112  
113 ## ^^^ TRW
114  
115 if ($self->serializer->can ('register_ns')) { ## TRW
116 $self->serializer->register_ns("http://schemas.xmlsoap.org/wsdl/soap/","wsdlsoap");
117 $self->serializer->register_ns("http://schemas.xmlsoap.org/wsdl/","wsdl");
118 $self->serializer->register_ns("http://uif.simbad.cds","intf");
119 $self->serializer->register_ns("http://uif.simbad.cds","impl");
120 $self->serializer->register_ns("http://schemas.xmlsoap.org/soap/encoding/","soapenc");
121 $self->serializer->register_ns("http://xml.apache.org/xml-soap","apachesoap");
122 $self->serializer->register_ns("http://www.w3.org/2001/XMLSchema","xsd");
123 } ## TRW
124 my $som = $self->SUPER::call($method => @parameters);
125 if ($self->want_som) {
126 return $som;
127 }
128 ## TRW vvvv
129 ## UNIVERSAL::isa($som => 'SOAP::SOM') ? wantarray ? $som->paramsall : $som->result : $som;
130 return eval {$som->isa('SOAP::SOM')} ? wantarray ? $som->paramsall : $som->result : $som;
131 ## TRW ^^^^
132 }
133  
134 sub BEGIN {
135 no strict 'refs';
136 for my $method (qw(want_som)) {
137 my $field = '_' . $method;
138 *$method = sub {
139 my $self = shift->new;
140 @_ ? ($self->{$field} = shift, return $self) : return $self->{$field};
141 }
142 }
143 }
144  
145 no strict 'refs';
146 for my $method (@EXPORT_OK) {
147 ## TRW my %method = %{$methods{$method}};
148 *$method = sub {
149 ## TRW vvvv
150 ## my $self = UNIVERSAL::isa($_[0] => __PACKAGE__)
151 my $self = eval {$_[0]->isa(__PACKAGE__)}
152 ## TRW ^^^^
153 ? ref $_[0] ? shift # OBJECT
154 # CLASS, either get self or create new and assign to self
155 : (shift->self || __PACKAGE__->self(__PACKAGE__->new))
156 # function call, either get self or create new and assign to self
157 : (__PACKAGE__->self || __PACKAGE__->self(__PACKAGE__->new));
158 $self->_call($method, @_);
159 }
160 }
161  
162 sub AUTOLOAD {
163 my $method = substr($AUTOLOAD, rindex($AUTOLOAD, '::') + 2);
164 return if $method eq 'DESTROY' || $method eq 'want_som';
165 die "Unrecognized method '$method'. List of available method(s): @EXPORT_OK\n";
166 }
167  
168 1;