1package 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-2021 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 9use strict; 10use warnings; 11 12our $VERSION = '0.046'; 13## TRW ^^^^ 14 15my %methods = ( 16queryObjectById => { 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 27queryObjectByBib => { 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 38queryObjectByCoord => { 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 52use SOAP::Lite; 53use Exporter; 54use Carp (); 55our @CARP_NOT = qw{SOAP::Lite}; 56 57use 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 62sub _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 my @parameters = (); 80## TRW foreach my $param (@_) { 81 foreach my $param (@parm) { ## TRW 82 if (@templates) { 83 my $template = shift @templates; 84## TRW my ($prefix,$typename) = SOAP::Utils::splitqname($template->type); 85 my (undef,$typename) = SOAP::Utils::splitqname($template->type); ## TRW 86 my $method = 'as_'.$typename; 87 # TODO - if can('as_'.$typename) {...} 88 my $result = $self->serializer->$method($param, $template->name, $template->type, $template->attr); 89 push(@parameters, $template->value($result->[2])); 90 } else { 91 push(@parameters, $param); 92 } 93 } 94 95## TRW $self->endpoint($method{endpoint}) 96## TRW ->ns($method{namespace}) 97## TRW ->on_action(sub{qq!"$method{soapaction}"!}); 98 99## vvv TRW 100 101if ($self->can ('ns')) { 102 $self->endpoint($endpoint) 103 ->ns($method{namespace}) 104 ->on_action (sub{$method{soapaction}}); 105} else { 106 $self->endpoint($endpoint) 107 ->envprefix ('soap') 108 ->uri($method{namespace}) 109 ->on_action (sub{$method{soapaction}}); 110} 111 112## ^^^ TRW 113 114if ($self->serializer->can ('register_ns')) { ## TRW 115$self->serializer->register_ns("http://schemas.xmlsoap.org/wsdl/soap/","wsdlsoap"); 116 $self->serializer->register_ns("http://schemas.xmlsoap.org/wsdl/","wsdl"); 117 $self->serializer->register_ns("http://uif.simbad.cds","intf"); 118 $self->serializer->register_ns("http://uif.simbad.cds","impl"); 119 $self->serializer->register_ns("http://schemas.xmlsoap.org/soap/encoding/","soapenc"); 120 $self->serializer->register_ns("http://xml.apache.org/xml-soap","apachesoap"); 121 $self->serializer->register_ns("http://www.w3.org/2001/XMLSchema","xsd"); 122} ## TRW 123 my $som = $self->SUPER::call($method => @parameters); 124 if ($self->want_som) { 125 return $som; 126 } 127 ## TRW vvvv 128 ## UNIVERSAL::isa($som => 'SOAP::SOM') ? wantarray ? $som->paramsall : $som->result : $som; 129 return eval {$som->isa('SOAP::SOM')} ? wantarray ? $som->paramsall : $som->result : $som; 130 ## TRW ^^^^ 131} 132 133sub BEGIN { 134 no strict 'refs'; 135 for my $method (qw(want_som)) { 136 my $field = '_' . $method; 137 *$method = sub { 138 my $self = shift->new; 139 @_ ? ($self->{$field} = shift, return $self) : return $self->{$field}; 140 } 141 } 142} 143 144no strict 'refs'; 145for my $method (@EXPORT_OK) { 146## TRW my %method = %{$methods{$method}}; 147 *$method = sub { 148 ## TRW vvvv 149 ## my $self = UNIVERSAL::isa($_[0] => __PACKAGE__) 150 my $self = eval {$_[0]->isa(__PACKAGE__)} 151 ## TRW ^^^^ 152 ? ref $_[0] ? shift # OBJECT 153 # CLASS, either get self or create new and assign to self 154 : (shift->self || __PACKAGE__->self(__PACKAGE__->new)) 155 # function call, either get self or create new and assign to self 156 : (__PACKAGE__->self || __PACKAGE__->self(__PACKAGE__->new)); 157 $self->_call($method, @_); 158 } 159} 160 161sub AUTOLOAD { 162 my $method = substr($AUTOLOAD, rindex($AUTOLOAD, '::') + 2); 163 return if $method eq 'DESTROY' || $method eq 'want_som'; 164 die "Unrecognized method '$method'. List of available method(s): @EXPORT_OK\n"; 165} 166 1671; 168