This file is indexed.

/usr/share/perl5/Bio/Tools/Run/AnalysisFactory/soap.pm is in libbio-perl-run-perl 1.6.9-2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
# $Id$
#
# BioPerl module Bio::Tools::Run::AnalysisFactory::soap.pm
#
# Please direct questions and support issues to <bioperl-l@bioperl.org> 
#
# Cared for by Martin Senger <martin.senger@gmail.com>
# For copyright and disclaimer see below.

# POD documentation - main docs before the code

=head1 NAME

Bio::Tools::Run::AnalysisFactory::soap - A SOAP-based access to the list of analysis tools

=head1 SYNOPSIS

Do not use this object directly, it is recommended to access it and use
it through the I<Bio::Tools::Run::AnalysisFactory> module:

  use Bio::Tools::Run::AnalysisFactory;
  my $list = Bio::Tools::Run::AnalysisFactory->new(-access => 'soap')
     ->available_analyses;
  print join ("\n", @$list) . "\n";

=head1 DESCRIPTION

All public methods are documented in the interface module
C<Bio::Factory::AnalysisI>.

=head1 FEEDBACK

=head2 Mailing Lists

User feedback is an integral part of the evolution of this and other
Bioperl modules. Send your comments and suggestions preferably to
the Bioperl mailing list.  Your participation is much appreciated.

  bioperl-l@bioperl.org                  - General discussion
  http://bioperl.org/wiki/Mailing_lists  - About the mailing lists

=head2 Support 

Please direct usage questions or support issues to the mailing list:

I<bioperl-l@bioperl.org>

rather than to the module maintainer directly. Many experienced and 
reponsive experts will be able look at the problem and quickly 
address it. Please include a thorough description of the problem 
with code and data examples if at all possible.

=head2 Reporting Bugs

Report bugs to the Bioperl bug tracking system to help us keep track
of the bugs and their resolution. Bug reports can be submitted via the
web:

  http://redmine.open-bio.org/projects/bioperl/

=head1 AUTHOR

Martin Senger (martin.senger@gmail.com)

=head1 COPYRIGHT

Copyright (c) 2003, Martin Senger and EMBL-EBI.
All Rights Reserved.

This module is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.

=head1 DISCLAIMER

This software is provided "as is" without warranty of any kind.

=head1 SEE ALSO

=over

=item *

http://www.ebi.ac.uk/soaplab/Perl_Client.html

=back

=head1 BUGS AND LIMITATIONS

None known at the time of writing this.

=head1 APPENDIX

The main documentation details are in
C<Bio::Factory::AnalysisI>.

=cut

# Let the code begin...

package Bio::Tools::Run::AnalysisFactory::soap;
use vars qw(@ISA $Revision $DEFAULT_LOCATION @DEFAULT_DIR_SERVICE);
use strict;

use Bio::Tools::Run::AnalysisFactory;
use Bio::Tools::Run::Analysis;
use SOAP::Lite
    on_fault => sub {
	my $soap = shift;
	my $res = shift;
	my $msg =
	    ref $res ?
		"--- SOAP FAULT ---\n" .
		'faultcode:   ' . $res->faultcode . "\n" .
		'faultstring: ' . Bio::Tools::Run::AnalysisFactory::soap::_clean_msg ($res->faultstring)
	      : "--- TRANSPORT ERROR ---\n" . $soap->transport->status . "\n$res\n";
        Bio::Tools::Run::AnalysisFactory::soap->throw ($msg);
    }
;

@ISA = qw(Bio::Tools::Run::AnalysisFactory);

BEGIN {
    $Revision = q[$Id$];

    # where to go...
    $DEFAULT_LOCATION = 'http://www.ebi.ac.uk/soaplab/services';

    # ...and what to find there
    # (this is a list of service names available from the given location;
    #  those that do not exist are ignored; if none exists then only
    #  location - without any service name appended - is used)
    @DEFAULT_DIR_SERVICE = ('AnalysisFactory', 'GowlabFactory');
}

# -----------------------------------------------------------------------------

=head2 _initialize

 Usage   : my $factory = Bio::Tools::Run::AnalysisFactory->new(@args);
           (_initialize is internally called from the 'new()' method)
 Returns : nothing interesting
 Args    : This module recognises and uses following arguments:
             -location
             -httpproxy
             -soap
	   Additionally, the main module Bio::Tools::Run::AnalysisFactory
           recognises also:
             -access

It populates calling object with the given arguments, and then - for
some attributes and only if they are not yet populated - it assigns
some default values.

This is an actual new() method (except for the real object creation
and its blessing which is done in the parent class Bio::Root::Root in
method _create_object).

Note that this method is called always as an I<object> method (never as
a I<class> method) - and that the object who calls this method may
already be partly initiated (from Bio::Tools::Run::AnalysisFactory::new method);
so if you need to do some tricks with the 'class invocation' you need to
change Bio::Tools::Run::AnalysisFactory I<new> method, not this one.

=over

=item -location

A URL (also called an I<endpoint>) defining where is located a Web Service
functioning for this object.

Default is C<http://www.ebi.ac.uk/soaplab/services> (a service running
at European Bioinformatics Institute on top of most of the EMBOSS
analyses, and on top of few others).

For example, if you run your own Web Service using Java(TM) Apache Axis
toolkit, the location might be something like
C<http://localhost:8080/axis/services>.

=item -httpproxy

In addition to the I<location> parameter, you may need
to specify also a location/URL of an HTTP proxy server
(if your site requires one). The expected format is C<http://server:port>.
There is no default value.

=item -soap

Defines your own SOAP::Lite object. Useful if you need finer-grained
access to many features and attributes of the wonderful Paul Kulchenko's
module.

=back

=cut

# '

sub _initialize {
    my ($self, @args) = @_;
    
    # make a hashtable from @args
    my %param = @args;
    @param { map { lc $_ } keys %param } = values %param; # lowercase keys

    # copy all @args into this object (overwriting what may already be
    # there) - changing '-key' into '_key'
    my $new_key;
    foreach my $key (keys %param) {
	($new_key = $key) =~ s/^-/_/;
	$self->{ $new_key } = $param { $key };
    }

    # finally add default values for those keys who have default value
    # and who are not yet in the object
    $self->{'_location'} = $DEFAULT_LOCATION unless $self->{'_location'};

    # create a SOAP object which will do the main job
    # ('uri' (representing a service name) will be added before each call) 
    unless ($self->{'_soap'}) {
	if (defined $self->{'_httpproxy'}) {
	    $self->{'_soap'} = SOAP::Lite
		-> proxy ($self->{'_location'},
			  proxy => ['http' => $self->{'_httpproxy'}]);
	} else {
	    $self->{'_soap'} = SOAP::Lite
		-> proxy ($self->{'_location'});
	}
    }
}

sub _clean_msg {
    my ($msg) = @_;
    $msg =~ s/^org\.embl\.ebi\.SoaplabShare\.SoaplabException\:\s*//;
    $msg;
}

# String[] getAvailableCategories()
sub available_categories {
    my ($self) = @_;
    my $soap = $self->{'_soap'};

    my @result = ();
    my $okay = 0;
    foreach my $service_name (@DEFAULT_DIR_SERVICE) {
	$soap-> uri ($service_name);
	eval {
	    push (@result, @{ $soap->getAvailableCategories->result });
	};
	$okay = 1 unless $@;
    }
    return $soap->getAvailableCategories->result unless $okay;
    \@result;
}

# String[] getAvailableAnalyses()
# String[] getAvailableAnalysesInCategory (String categoryName)
sub available_analyses {
    my ($self, $category) = @_;
    my $soap = $self->{'_soap'};

    my @result = ();
    my $okay = 0;

    if (defined $category) {
	foreach my $service_name (@DEFAULT_DIR_SERVICE) {
	    $soap-> uri ($service_name);
	    eval {
		push (@result, @{ $soap->getAvailableAnalysesInCategory (SOAP::Data->type (string => $category))->result });
	    };
	    $okay = 1 unless $@;
	}
	return
	    $soap->getAvailableAnalysesInCategory (SOAP::Data->type (string => $category))
	    ->result unless $okay;
	\@result;

    } else {
	foreach my $service_name (@DEFAULT_DIR_SERVICE) {
	    $soap-> uri ($service_name);
	    eval {
		push (@result, @{ $soap->getAvailableAnalyses->result });
	    };
	    $okay = 1 unless $@;
	}
	return
	    $soap->getAvailableAnalyses->result unless $okay;
	\@result;
    }
}

# String getServiceLocation (String analysisName)
sub create_analysis {
    my ($self, $name) = @_;

    # service name
    my @name  = ('-name', $name) if $name;

    # ask for an endpoint
    my $soap = $self->{'_soap'};
    my $location;
    foreach my $service_name (@DEFAULT_DIR_SERVICE) {
	$soap-> uri ($service_name);
	eval {
	    $location = $soap->getServiceLocation (SOAP::Data->type (string => $name))->result;
	};
	last if defined $location;
    }
    unless (defined $location) {
	$location = $soap->getServiceLocation (SOAP::Data->type (string => $name)) ->result;
    }
    my @location  = ('-location', $location) if $location;

    # share some of my properties with the new Bio::Analysis object
    my @access  = ('-access', $self->{'_access'}) if $self->{'_access'};
    my @httpproxy = ('-httpproxy', $self->{'_httpproxy'}) if $self->{'_httpproxy'};

    Bio::Tools::Run::Analysis->new(@name, @location, @httpproxy, @access);
}



=head2 VERSION and Revision

 Usage   : print $Bio::Tools::Run::AnalysisFactory::soap::VERSION;
           print $Bio::Tools::Run::AnalysisFactory::soap::Revision;

=cut


1;
__END__