Raw content of Bio::DB::Biblio::soap# $Id: soap.pm,v 1.5 2002/10/22 07:45:14 lapp Exp $
#
# BioPerl module Bio::DB::Biblio::soap.pm
#
# Cared for by Martin Senger
# For copyright and disclaimer see below.
# POD documentation - main docs before the code
=head1 NAME
Bio::DB::Biblio::soap - A SOAP-based access to a bibliographic query service
=head1 SYNOPSIS
Do not use this object directly, it is recommended to access it and use
it through the I module:
use Bio::Biblio;
my $biblio = new Bio::Biblio (-access => 'soap');
=head1 DESCRIPTION
This object contains the real implementation of a Bibliographic Query
Service as defined in L - using a SOAP protocol
to access a WebService (a remote server) that represents a
bibliographic repository.
=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/MailList.shtml - About the mailing lists
=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
email or the web:
bioperl-bugs@bioperl.org
http://bugzilla.bioperl.org/
=head1 AUTHOR
Martin Senger (senger@ebi.ac.uk)
=head1 COPYRIGHT
Copyright (c) 2002 European Bioinformatics Institute. 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 BUGS AND LIMITATIONS
=over
=item *
Methods returning a boolean value (I, I and
I) can be used only with SOAP::Lite version 0.52 and newer
(probably due to a bug in the older SOAP::Lite).
=item *
It does not use WSDL. Coming soon...
=item *
There is an open question to discuss: should the service return
citations as type I or rather as type I? What is
faster? What is better for keeping non-ASCII characters untouched? How
the decision would be influenced if the transparent compression
support is introduced?
=item *
More testing and debugging needed to ensure that returned citations
are properly transferred even if they contain foreign characters.
=back
=head1 APPENDIX
The main documentation details are to be found in
L.
Here is the rest of the object methods. Internal methods are preceded
with an underscore _.
=cut
# Let the code begin...
package Bio::DB::Biblio::soap;
use vars qw(@ISA $VERSION $Revision $DEFAULT_SERVICE $DEFAULT_NAMESPACE);
use strict;
use Bio::Biblio; # TBD: ?? WHY SHOULD I DO THIS ??
use SOAP::Lite
on_fault => sub {
my $soap = shift;
my $res = shift;
my $msg =
ref $res ? "--- SOAP FAULT ---\n" . $res->faultcode . " " . $res->faultstring
: "--- TRANSPORT ERROR ---\n" . $soap->transport->status;
Bio::DB::Biblio::soap->throw ( -text => $msg );
}
;
@ISA = qw(Bio::Biblio);
BEGIN {
# set the version for version checking
$VERSION = do { my @r = (q$Revision: 1.5 $ =~ /\d+/g); sprintf "%d.%-02d", @r };
$Revision = q$Id: soap.pm,v 1.5 2002/10/22 07:45:14 lapp Exp $;
# where to go...
$DEFAULT_SERVICE = 'http://industry.ebi.ac.uk/soap/openBQS';
# ...and what to find there
$DEFAULT_NAMESPACE = 'http://industry.ebi.ac.uk/openBQS';
}
# -----------------------------------------------------------------------------
=head2 _initialize
Usage : my $obj = new Bio::Biblio (-access => 'soap' ...);
(_initialize is internally called from this constructor)
Returns : nothing interesting
Args : This module recognises and uses following arguments:
-namespace => 'urn'
The namespace used by the WebService that is being
accessed. It is a string which guarantees its world-wide
uniqueness - therefore it often has a style of a URL -
but it does not mean that such pseudo-URL really exists.
Default is 'http://industry.ebi.ac.uk/openBQS'
(which well corresponds with the default '-location' -
see module Bio::Biblio).
-destroy_on_exit => '0'
Default value is '1' which means that all Bio::Biblio
objects - when being finalised - will send a request
to the remote WebService to forget the query collections
they represent.
If you change it to '0' make sure that you know the
query collection identification - otherwise you will
not be able to re-established connection with it.
This can be done by calling method get_collection_id.
-collection_id => '...'
It defines what query collection will this object work
with. Use this argument when you know a collection ID
of an existing query collection and when you wish to
re-established connection with it.
By default, the collection IDs are set automatically
by the query methods - they return Bio::Biblio objects
already having a collection ID.
A missing or undefined collection ID means that the
object represents the whole bibliographic repository
(which again means that some methods, like get_all,
will be probably refused).
-soap => a SOAP::Lite object
Usually all Bio::Biblio objects share an instance of
the underlying SOAP::Lite module. But you are free
to have more - perhaps with different characteristics.
See the code for attributes of the default SOAP::Lite
object.
-httpproxy => 'http://server:port'
In addition to the 'location' parameter, you may need
to specify also a location/URL of a HTTP proxy server
(if your site requires one).
Additionally, the main module Bio::Biblio recognises
also:
-access => '...'
-location => '...'
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