Astro-Catalog
view release on metacpan or search on metacpan
lib/Astro/Catalog/Query/Sesame.pm view on Meta::CPAN
$catalog = $query->querydb();
=cut
sub querydb {
my $self = shift;
# clean out buffer
$self->_set_raw("");
my $endpoint = $self->endpoint();
my %options = $self->_translate_options();
# return unless we haev a target, set it otherwise
return undef unless $self->query_options("object");
# make sesame query
my $service = SOAP::Lite->service($self->endpoint());
my $ident = $self->query_options("object");
$ident =~ s/\+/ /g;
my $buffer;
eval { $buffer = $service->sesame( $ident, "u" ); };
if ($@) {
my $status = $service->transport()->status();
croak("Error ($status): $@");
return;
lib/Astro/Catalog/Query/Sesame.pm view on Meta::CPAN
=back
=begin __PRIVATE_METHODS__
=head2 Private methods
These methods are for internal use only.
=over 4
=item B<_default_endpoint>
=cut
sub _default_endpoint {
return "http://cdsws.u-strasbg.fr/axis/services/Sesame?wsdl";
}
=item B<_default_urn>
=cut
sub _default_urn {
return undef;
}
lib/Astro/Catalog/Transport/WebService.pm view on Meta::CPAN
# SETTING URL
if (@_) {
# set the url option
my $urn = shift;
$self->{URN} = $urn;
}
return $self->{URN};
}
=item B<endpoint>
Return the current endpoint for the query
$host = $q->endpoint();
$q->endpoint('http://www.blah.org:8080');
Can also be used to set the endpoint. If the endpoint is a wsdl file
the SOAP::Lite object will automagically be configured to use the
correct URN, e.g.
$q->endpoint('http://cdsws.u-strasbg.fr/axis/Sesame.jws?wsdl');
=cut
sub endpoint {
my $self = shift;
# SETTING ENDPOINT
if (@_) {
# set the url option
my $endpoint = shift;
if ($endpoint =~ /wsdl$/) {
$self->{SERVICE} = 1;
}
$self->{ENDPOINT} = $endpoint;
}
if (defined $self->{ENDPOINT}) {
return $self->{ENDPOINT};
}
else {
return $self->_default_endpoint();
}
}
=back
=head2 General Methods
=over 4
=item B<configure>
lib/Astro/Catalog/Transport/WebService.pm view on Meta::CPAN
The default URN for the hostname. Must be specified in a sub-class.
$host = $q->_default_urn();
=cut
sub _default_urn {
croak "default URN must be specified in subclass\n";
}
=item B<_default_endpoint>
The default endpoint. Must be specified in a sub-class.
$host = $q->_default_endpoint();
=cut
sub _default_endpoint {
croak "default endpoint must be specified in subclass\n";
}
=item B<_is_service>
Whether the webservice uses a URN and $endpoint, or is
a service specified by a WSDL file
$bool = $q->_is_service();
=back
=cut
sub _is_service {
croak "decision must be made by subclass\n";
( run in 0.467 second using v1.01-cache-2.11-cpan-49f99fa48dc )