CaCORE

 view release on metacpan or  search on metacpan

lib/CaCORE/ApplicationService.pm  view on Meta::CPAN



##########################################################################################
package CaCORE::ApplicationService;
##########################################################################################

BEGIN {
	use LWP::UserAgent;
	use HTTP::Request::Common;
}

$VERSION = '3.2';

# These are default values
my $default_proxy = "http://cabio.nci.nih.gov/cacore32/ws/caCOREService";

# CPAN namespace mapping to Java package mapping
my %cpan2java;
$cpan2java{"CaCORE::Common::Provenance"} = "gov.nih.nci.common.provenance.domain.ws";
$cpan2java{"CaCORE::Common"} = "gov.nih.nci.common.domain.ws";
$cpan2java{"CaCORE::CaDSR::UMLProject"} = "gov.nih.nci.cadsr.umlproject.domain.ws";
$cpan2java{"CaCORE::CaDSR"} = "gov.nih.nci.cadsr.domain.ws";
$cpan2java{"CaCORE::CaBIO"} = "gov.nih.nci.cabio.domain.ws";
$cpan2java{"CaCORE::EVS"} = "gov.nih.nci.evs.domain.ws";

# CPAN namespace mapping to webservice
my %cpan2ws;
$cpan2ws{"CaCORE::Common::Provenance"} = "urn:ws.domain.provenance.common.nci.nih.gov";
$cpan2ws{"CaCORE::Common"} = "urn:ws.domain.common.nci.nih.gov";
$cpan2ws{"CaCORE::CaDSR::UMLProject"} = "urn:ws.domain.umlproject.cadsr.nci.nih.gov";
$cpan2ws{"CaCORE::CaDSR"} = "urn:ws.domain.cadsr.nci.nih.gov";
$cpan2ws{"CaCORE::CaBIO"} = "urn:ws.domain.cabio.nci.nih.gov";
$cpan2ws{"CaCORE::EVS"} = "urn:ws.domain.evs.nci.nih.gov";


# instance()
# Module constructor.  Creates an singleton ApplicationService instance 
# if one doesn't already exist.  The instance reference is stored in the
# _instance variable of the $class package.
#
# Returns a reference to the existing, or a newly created singleton
# object.  If the _new_instance() method returns an undefined value
# then the constructer is deemed to have failed.
sub instance {
    my $class = shift;

    # get a reference to the _instance variable in the $class package 
    no strict 'refs';
    my $instance = \${ "$class\::_instance" };

    defined $$instance
	? $$instance
	: ($$instance = $class->_new_instance(@_));
}

# _new_instance(...)
# Simple constructor
sub _new_instance {
    my $class  = shift;
    my $self = {};
    bless $self, $class;
    # set the proxy, if not available, use default
    if( $#_ >= 0 ){ $self->{proxy} = shift;}
    else{ $self->{proxy} = $default_proxy; }
    return $self;
}

# construct a SOAP request to the caCORE server
sub queryObject {



( run in 0.855 second using v1.01-cache-2.11-cpan-75ffa21a3d4 )