[MOBY-guts] biomoby commit
Mark Wilkinson
mwilkinson at dev.open-bio.org
Wed Feb 13 07:39:29 UTC 2008
mwilkinson
Wed Feb 13 02:39:29 EST 2008
Update of /home/repository/moby/moby-live/Perl/MOBY/Client
In directory dev.open-bio.org:/tmp/cvs-serv15528/MOBY/Client
Modified Files:
Service.pm
Log Message:
adding new method raw_execute so that you can hit a service with a raw block of MOBY XML if you have constructed it by hand
moby-live/Perl/MOBY/Client Service.pm,1.37,1.38
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/Service.pm,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -r1.37 -r1.38
--- /home/repository/moby/moby-live/Perl/MOBY/Client/Service.pm 2007/02/20 15:13:42 1.37
+++ /home/repository/moby/moby-live/Perl/MOBY/Client/Service.pm 2008/02/13 07:39:29 1.38
@@ -308,6 +308,38 @@
}
}
+
+=head2 raw_execute
+
+ Usage : $result = $Service->raw_execute(inputXML => "<../>")
+ Function : execute the MOBY service using a raw MOBY input block
+ Returns : whatever the Service provides as output
+ Args : inputXML => "<moby:MOBY>.....</moby:MOBY>"
+
+=cut
+
+sub raw_execute {
+ my ( $self, %args ) = @_;
+ my $data = $args{inputXML};
+
+ my $METHOD = $self->serviceName;
+ my $response;
+
+ if ($self->category eq 'moby'){
+ eval { ( $response ) = $self->_soapService->$METHOD( $data ) };
+ if ($@) { die "Service execution failed: $@"}
+ else {return $response;} # the service execution failed then pass back ""
+ } elsif ($self->category eq 'post'){
+ my $response = $self->_executePOSTService(data => $data, method => $METHOD);
+ # currently SOAP::Lite does not execute POST WSDL, so we need to
+ # use LWP or something like that in the executePOSTService method
+ #eval { ( $response ) = $self->_soapService->$METHOD( $data ) };
+ unless ($response){ die "Service execution failed: $@"}
+ else {return $response;} # the service execution failed then pass back ""
+ }
+
+
+}
sub _executePOSTService {
my ($self, %args) = @_;
my $serviceName = $args{method};
More information about the MOBY-guts
mailing list