[MOBY-guts] biomoby commit

Mark Wilkinson mwilkinson at dev.open-bio.org
Thu Dec 7 17:23:41 UTC 2006


mwilkinson
Thu Dec  7 12:23:41 EST 2006
Update of /home/repository/moby/moby-live/Perl/MOBY/Client
In directory dev.open-bio.org:/tmp/cvs-serv29991/MOBY/Client

Modified Files:
	Service.pm 
Log Message:
untested.  It should now handle POST services and create valid POST WSDL.  not tested.
moby-live/Perl/MOBY/Client Service.pm,1.25,1.26
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/Service.pm,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- /home/repository/moby/moby-live/Perl/MOBY/Client/Service.pm	2006/07/07 22:25:12	1.25
+++ /home/repository/moby/moby-live/Perl/MOBY/Client/Service.pm	2006/12/07 17:23:41	1.26
@@ -67,7 +67,8 @@
 		uri          => [ undef, 'read/write' ],
 		serviceName  => [ undef, 'read/write' ],
 		_soapService => [ undef, 'read/write' ],
-		smessageVersion => ['0.87', 'read'	],
+		smessageVersion => ['0.88', 'read'	],
+		category	=> [undef, 'read/write'],
 	  );
 
 	#_____________________________________________________________
@@ -118,9 +119,11 @@
 	#print OUT $self->service;
 	#close OUT;
 	# ________________________________________
-	my $wsdl = 
-	  URI::Escape::uri_escape( $self->service );    # this seems to fix the bug
+	my $wsdl = URI::Escape::uri_escape( $self->service );    # this seems to fix the bug
 	return undef unless $wsdl;
+	if ($wsdl =~ /<http:binding verb=['"]POST['"]\/>/){
+		$self->category('post');
+	}
 	my $soap = SOAP::Lite->service( "data:,$wsdl" );
 	if ( $self->uri ) { $soap->uri( $self->uri ) }
 	$self->serviceName( &_getServiceName( $soap ) );
@@ -284,9 +287,17 @@
   my $METHOD = $self->serviceName;
   &_LOG( %args, $METHOD );
   my $response;
-  eval { ( $response ) = $self->_soapService->$METHOD( $data ) };
-  if ($@) { die "Service execution failed: $@"}
-  else {return $response;} # the service execution failed then pass back ""
+
+	if ($self->category eq 'post'){
+		my $d = SOAP::Data->name('data' => $data);
+		eval { ( $response ) = $self->_soapService->$METHOD($d) };
+		if ($@) { die "Service execution failed: $@"}
+		else {return $response;} # the service execution failed then pass back ""
+	} elsif ($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 ""
+	}
 }
 
 =head2 serviceName




More information about the MOBY-guts mailing list