[MOBY-guts] biomoby commit

José Manuel Rodríguez Carrasco jmrc at dev.open-bio.org
Wed Jul 18 10:47:44 UTC 2007


jmrc
Wed Jul 18 06:47:24 EDT 2007
Update of /home/repository/moby/moby-live/Perl/MOBY/Async
In directory dev.open-bio.org:/tmp/cvs-serv28328/Perl/MOBY/Async

Modified Files:
	LSAE.pm Service.pm SimpleServer.pm WSRF.pm 
Log Message:
Description:

Perl/MOBY/Makefile.PL
We try to add WSRF::Lite version (0.8.2.1) 
but it is not declared in the proper way there.

Perl/MOBY/Central.pm
The WSDL template has been remade for asynchronous services.
In the last version, it had a mix of RPC/encoded and document/literal in the only binding it had.
The solution has been distributing the operations on two disjunctive port types and bindings,
one for RPC/encoded operations and the other for document/literal operations.
In that way, the service has two ports, one for MOBY and the other for WSRF, both of them using the same endpoint.

The namespaces have been modified for the communication operations (SOAP,
WSRF, and MOBY).


Perl/MOBY/Async/*

The methods have been modified to use RPC/encoded for both input and output.

They accept namespaces from new asynchronous WSDL.



Date:
2007-07-18

Developers:
Jose Maria Fernandez (jmfernandez at cnio.es),
Jose Manuel Rodriguez (jmrodriguez at cnio.es) -
INB GN2 (CNIO, Spain).



moby-live/Perl/MOBY/Async LSAE.pm,1.3,1.4 Service.pm,1.7,1.8 SimpleServer.pm,1.3,1.4 WSRF.pm,1.2,1.3
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/MOBY/Async/LSAE.pm,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- /home/repository/moby/moby-live/Perl/MOBY/Async/LSAE.pm	2007/04/02 12:13:32	1.3
+++ /home/repository/moby/moby-live/Perl/MOBY/Async/LSAE.pm	2007/07/18 10:47:24	1.4
@@ -6,8 +6,14 @@
 
 =head1 AUTHORS
 
+Former developer
 Enrique de Andres Saiz (enrique.deandres at pcm.uam.es) -
-INB GNHC-1 (Madrid Science Park, Spain).
+INB GNHC-1 (Madrid Science Park, Spain) (2006-2007).
+
+Maintainers
+Jose Maria Fernandez (jmfernandez at cnio.es),
+Jose Manuel Rodriguez (jmrodriguez at cnio.es) - 
+INB GN2 (CNIO, Spain).
 
 =head1 DESCRIPTION
 
@@ -277,11 +283,11 @@
 		my $parser = XML::LibXML->new();
 		my $doc = $parser->parse_string($self->{XML});
 		my $lsae = $doc->getDocumentElement();
-		my @heartbeat_progress = ($lsae->getChildrenByTagName('heartbeat_progress'), $lsae->getChildrenByTagName('lsae:heartbeat_progress'));
-		my @percent_progress = ($lsae->getChildrenByTagName('percent_progress'), $lsae->getChildrenByTagName('lsae:percent_progress'));
-		my @state_changed = ($lsae->getChildrenByTagName('state_changed'), $lsae->getChildrenByTagName('lsae:state_changed'));
-		my @step_progress = ($lsae->getChildrenByTagName('step_progress'), $lsae->getChildrenByTagName('lsae:step_progress'));
-		my @time_progress = ($lsae->getChildrenByTagName('time_progress'), $lsae->getChildrenByTagName('lsae:time_progress'));
+		my @heartbeat_progress = ($lsae->getChildrenByTagName('heartbeat_progress'));
+		my @percent_progress = ($lsae->getChildrenByTagName('percent_progress'));
+		my @state_changed = ($lsae->getChildrenByTagName('state_changed'));
+		my @step_progress = ($lsae->getChildrenByTagName('step_progress'));
+		my @time_progress = ($lsae->getChildrenByTagName('time_progress'));
 		if (scalar(@heartbeat_progress)) {
 			$self->{type} = MOBY::Async::LSAE::LSAE_HEARTBEAT_PROGRESS_EVENT;
 		} elsif (scalar(@percent_progress)) {
@@ -307,7 +313,7 @@
 		my $parser = XML::LibXML->new();
 		my $doc = $parser->parse_string($self->{XML});
 		my $lsae = $doc->getDocumentElement();
-		$self->{id} = $lsae->getAttribute('id') || $lsae->getAttribute('moby:id');
+		$self->{id} = $lsae->getAttribute('id') || $lsae->getAttributeNS($WSRF::Constants::MOBY, 'id');
 	}
 	return $self->{id};
 }
@@ -320,7 +326,7 @@
 		my $parser = XML::LibXML->new();
 		my $doc = $parser->parse_string($self->{XML});
 		my $lsae = $doc->getDocumentElement();
-		$self->{timestamp} = $lsae->getAttribute('timestamp') || $lsae->getAttribute('moby:timestamp');
+		$self->{timestamp} = $lsae->getAttribute('timestamp') || $lsae->getAttributeNS($WSRF::Constants::MOBY, 'timestamp');
 	}
 	return $self->{timestamp};
 }
@@ -333,7 +339,7 @@
 		my $parser = XML::LibXML->new();
 		my $doc = $parser->parse_string($self->{XML});
 		my $lsae = $doc->getDocumentElement();
-		my @message = ($lsae->getChildrenByTagName('message'), $lsae->getChildrenByTagName('lsae:message'));
+		my @message = ($lsae->getChildrenByTagName('message'));
 		my $message = shift(@message);
 		$self->{message} = $message->getFirstChild->nodeValue if ($message);
 	}
@@ -350,9 +356,9 @@
 			my $parser = XML::LibXML->new();
 			my $doc = $parser->parse_string($self->{XML});
 			my $lsae = $doc->getDocumentElement();
-			my @message = ($lsae->getChildrenByTagName('percent_progress'), $lsae->getChildrenByTagName('lsae:percent_progress'));
+			my @message = ($lsae->getChildrenByTagName('percent_progress'));
 			my $message = shift(@message);
-			$self->{percentage} = $message->getAttribute('percentage') || $message->getAttribute('moby:percentage');
+			$self->{percentage} = $message->getAttribute('percentage');
 		}
 	}
 	return $self->{percentage};
@@ -368,9 +374,9 @@
 			my $parser = XML::LibXML->new();
 			my $doc = $parser->parse_string($self->{XML});
 			my $lsae = $doc->getDocumentElement();
-			my @message = ($lsae->getChildrenByTagName('state_changed'), $lsae->getChildrenByTagName('lsae:state_changed'));
+			my @message = ($lsae->getChildrenByTagName('state_changed'));
 			my $message = shift(@message);
-			$self->{previous_state} = $message->getAttribute('previous_state') || $message->getAttribute('moby:previous_state');
+			$self->{previous_state} = $message->getAttribute('previous_state');
 		}
 	}
 	return $self->{previous_state};
@@ -386,9 +392,9 @@
 			my $parser = XML::LibXML->new();
 			my $doc = $parser->parse_string($self->{XML});
 			my $lsae = $doc->getDocumentElement();
-			my @message = ($lsae->getChildrenByTagName('state_changed'), $lsae->getChildrenByTagName('lsae:state_changed'));
+			my @message = ($lsae->getChildrenByTagName('state_changed'));
 			my $message = shift(@message);
-			$self->{new_state} = $message->getAttribute('new_state') || $message->getAttribute('moby:new_state');
+			$self->{new_state} = $message->getAttribute('new_state');
 		}
 	}
 	return $self->{new_state};
@@ -404,9 +410,9 @@
 			my $parser = XML::LibXML->new();
 			my $doc = $parser->parse_string($self->{XML});
 			my $lsae = $doc->getDocumentElement();
-			my @message = ($lsae->getChildrenByTagName('step_progress'), $lsae->getChildrenByTagName('lsae:step_progress'));
+			my @message = ($lsae->getChildrenByTagName('step_progress'));
 			my $message = shift(@message);
-			$self->{total_steps} = $message->getAttribute('total_steps') || $message->getAttribute('moby:total_steps');
+			$self->{total_steps} = $message->getAttribute('total_steps');
 		}
 	}
 	return $self->{total_steps};
@@ -422,9 +428,9 @@
 			my $parser = XML::LibXML->new();
 			my $doc = $parser->parse_string($self->{XML});
 			my $lsae = $doc->getDocumentElement();
-			my @message = ($lsae->getChildrenByTagName('step_progress'), $lsae->getChildrenByTagName('lsae:step_progress'));
+			my @message = ($lsae->getChildrenByTagName('step_progress'));
 			my $message = shift(@message);
-			$self->{steps_completed} = $message->getAttribute('steps_completed') || $message->getAttribute('moby:steps_completed');
+			$self->{steps_completed} = $message->getAttribute('steps_completed');
 		}
 	}
 	return $self->{steps_completed};
@@ -440,9 +446,9 @@
 			my $parser = XML::LibXML->new();
 			my $doc = $parser->parse_string($self->{XML});
 			my $lsae = $doc->getDocumentElement();
-			my @message = ($lsae->getChildrenByTagName('time_progress'), $lsae->getChildrenByTagName('lsae:time_progress'));
+			my @message = ($lsae->getChildrenByTagName('time_progress'));
 			my $message = shift(@message);
-			$self->{remaining} = $message->getAttribute('remaining') || $message->getAttribute('moby:remaining');
+			$self->{remaining} = $message->getAttribute('remaining');
 		}
 	}
 	return $self->{remaining};
@@ -464,7 +470,7 @@
 	
 	my $id = " id=\"".$self->{id}."\"" if defined $self->{id};
 	my $timestamp = " timestamp=\"".$self->{timestamp}."\"" if defined $self->{timestamp};
-	my $header = "<analysis_event$id$timestamp>";
+	my $header = "<analysis_event$id$timestamp xmlns=''>";
 	my $footer = "</analysis_event>";
 	my $message = "<message>".$self->{message}."</message>" if defined $self->{message};
 	

===================================================================
RCS file: /home/repository/moby/moby-live/Perl/MOBY/Async/Service.pm,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- /home/repository/moby/moby-live/Perl/MOBY/Async/Service.pm	2007/04/02 12:13:32	1.7
+++ /home/repository/moby/moby-live/Perl/MOBY/Async/Service.pm	2007/07/18 10:47:24	1.8
@@ -6,8 +6,14 @@
 
 =head1 AUTHORS
 
+Former developer
 Enrique de Andres Saiz (enrique.deandres at pcm.uam.es) -
-INB GNHC-1 (Madrid Science Park, Spain).
+INB GNHC-1 (Madrid Science Park, Spain) (2006-2007).
+
+Maintainers
+Jose Maria Fernandez (jmfernandez at cnio.es),
+Jose Manuel Rodriguez (jmrodriguez at cnio.es) - 
+INB GN2 (CNIO, Spain).
 
 =head1 DESCRIPTION
 
@@ -225,7 +231,7 @@
 	}
 	my $version = $self->{smessageVersion};
 	$data = "<?xml version='1.0' encoding='UTF-8'?>
-	<moby:MOBY xmlns:moby='http://www.biomoby.org/moby' moby:smessageVersion='$version'>
+	<moby:MOBY moby:smessageVersion='$version' xmlns:moby='$WSRF::Constants::MOBY_MESSAGE_NS' xmlns='$WSRF::Constants::MOBY_MESSAGE_NS'>
 	      <moby:mobyContent>
 	          $data
 	      </moby:mobyContent>
@@ -240,19 +246,19 @@
 	die "ERROR:  ".$ans->faultstring if ($ans->fault);
 	
 	# Get address from the returned Endpoint Reference
-	my $address = $ans->match("//Body//{$WSRF::Constants::WSA}Address") ?
-	              $ans->valueof("//Body//{$WSRF::Constants::WSA}Address") :
+	my $address = $ans->match("//{$SOAP::Constants::NS_ENV}Body//{$WSRF::Constants::WSA}Address") ?
+	              $ans->valueof("//{$SOAP::Constants::NS_ENV}Body//{$WSRF::Constants::WSA}Address") :
 	              die "ERROR:  no EndpointReference returned";
 	die "ERROR:  no address into returned EndpointReference" unless ($address);
 	
 	# Get resource identifier from the returned Endpoint Reference
 	my $identifier;
-	if ($ans->dataof('//Body//ReferenceParameters/*')) {
-		foreach my $a ($ans->dataof('//Body//ReferenceParameters/*')) {
+	if ($ans->dataof("//{$SOAP::Constants::NS_ENV}Body//{$WSRF::Constants::WSA}ReferenceParameters/*")) {
+		foreach my $a ($ans->dataof("//{$SOAP::Constants::NS_ENV}Body//{$WSRF::Constants::WSA}ReferenceParameters/*")) {
 			my $name  = $a->name();
 			my $uri   = $a->uri();
 			my $value = $a->value();
-			if ($name eq "ServiceInvocationId") {
+			if ($name eq "ServiceInvocationId" && $uri eq $WSRF::Constants::MOBY) {
 				$identifier = $value;
 				last;
 			}
@@ -263,7 +269,7 @@
 	# Compose the Endpoint Reference
 	my $EPR = WSRF::WS_Address->new();
 	$EPR->Address($address);
-	$EPR->ReferenceParameters('<moby:ServiceInvocationId xmlns:moby="'.$WSRF::Constants::MOBY.'">'.$identifier.'</moby:ServiceInvocationId>');
+	$EPR->ReferenceParameters('<mobyws:ServiceInvocationId xmlns:mobyws="'.$WSRF::Constants::MOBY.'">'.$identifier.'</mobyws:ServiceInvocationId>');
 	
 	print XML::LibXML->new->parse_string($EPR->XML)->getDocumentElement()->toString."\n\n" unless ($self->{silent});
 	
@@ -358,7 +364,7 @@
 	}
 	my $version = $self->{smessageVersion};
 	$data = "<?xml version='1.0' encoding='UTF-8'?>
-	<moby:MOBY xmlns:moby='http://www.biomoby.org/moby' moby:smessageVersion='$version'>
+	<moby:MOBY moby:smessageVersion='$version' xmlns='$WSRF::Constants::MOBY_MESSAGE_NS' xmlns:moby='$WSRF::Constants::MOBY_MESSAGE_NS'>
 	      <moby:mobyContent>
 	          $data
 	      </moby:mobyContent>
@@ -373,19 +379,19 @@
 	die "ERROR:  ".$ans->faultstring if ($ans->fault);
 	
 	# Get address from the returned Endpoint Reference
-	my $address = $ans->match("//Body//{$WSRF::Constants::WSA}Address") ?
-	              $ans->valueof("//Body//{$WSRF::Constants::WSA}Address") :
+	my $address = $ans->match("//{$SOAP::Constants::NS_ENV}Body//{$WSRF::Constants::WSA}Address") ?
+	              $ans->valueof("//{$SOAP::Constants::NS_ENV}Body//{$WSRF::Constants::WSA}Address") :
 	              die "ERROR:  no EndpointReference returned";
 	die "ERROR:  no address into returned EndpointReference" unless ($address);
 	
 	# Get resource identifier from the returned Endpoint Reference
 	my $identifier;
-	if ($ans->dataof('//Body//ReferenceParameters/*')) {
-		foreach my $a ($ans->dataof('//Body//ReferenceParameters/*')) {
+	if ($ans->dataof("//{$SOAP::Constants::NS_ENV}Body//{$WSRF::Constants::WSA}ReferenceParameters/*")) {
+		foreach my $a ($ans->dataof("//{$SOAP::Constants::NS_ENV}Body//{$WSRF::Constants::WSA}ReferenceParameters/*")) {
 			my $name  = $a->name();
 			my $uri   = $a->uri();
 			my $value = $a->value();
-			if ($name eq "ServiceInvocationId") {
+			if ($name eq "ServiceInvocationId" && $uri eq $WSRF::Constants::MOBY) {
 				$identifier = $value;
 				last;
 			}
@@ -396,7 +402,7 @@
 	# Compose the Endpoint Reference
 	my $EPR = WSRF::WS_Address->new();
 	$EPR->Address($address);
-	$EPR->ReferenceParameters('<moby:ServiceInvocationId xmlns:moby="'.$WSRF::Constants::MOBY.'">'.$identifier.'</moby:ServiceInvocationId>');
+	$EPR->ReferenceParameters('<mobyws:ServiceInvocationId xmlns:mobyws="'.$WSRF::Constants::MOBY.'">'.$identifier.'</mobyws:ServiceInvocationId>');
 	
 	print XML::LibXML->new->parse_string($EPR->XML)->getDocumentElement()->toString."\n\n" unless ($self->{silent});
 	
@@ -502,7 +508,7 @@
 sub _getServiceEndpoint {
 	my ($wsdl) = @_;
 	
-	$wsdl =~ /location\s*=\s*["|'](.+)["|']/;
+	$wsdl =~ /address location\s*=\s*["|'](.+)["|']/;
 	my $serviceEndpoint = $1;
 	
 	return $serviceEndpoint;
@@ -609,19 +615,19 @@
 		my $moby = $doc->getDocumentElement();
 		
 		# Get authority
-		my @mobyContents = ($moby->getChildrenByTagName('mobyContent'), $moby->getChildrenByTagName('moby:mobyContent'));
+		my @mobyContents = ($moby->getChildrenByTagNameNS($WSRF::Constants::MOBY_MESSAGE_NS, 'mobyContent'));
 		my $mobyContent = shift(@mobyContents);
-		my $authority = $mobyContent->getAttribute('authority') || $mobyContent->getAttribute('moby:authority');
+		my $authority = $mobyContent->getAttribute('authority') || $mobyContent->getAttributeNS($WSRF::Constants::MOBY_MESSAGE_NS, 'authority');
 		push(@authorities, $authority);
 		
 		# Get exceptions
-		my @mobyException = ($moby->getElementsByTagName('mobyException'), $moby->getElementsByTagName('moby:mobyException'));
+		my @mobyException = ($moby->getElementsByTagNameNS($WSRF::Constants::MOBY_MESSAGE_NS, 'mobyException'));
 		foreach my $mobyException (@mobyException) {
 			push(@exceptions, $mobyException->toString());
 		}
 		
 		# Get queries
-		my @mobyData = ($moby->getElementsByTagName('mobyData'), $moby->getElementsByTagName('moby:mobyData'));
+		my @mobyData = ($moby->getElementsByTagNameNS($WSRF::Constants::MOBY_MESSAGE_NS, 'mobyData'));
 		foreach my $mobyData (@mobyData) {
 			push(@queries, $mobyData->toString());
 		}
@@ -629,7 +635,7 @@
 	
 	my $moby;
 	$moby  = responseHeader(shift(@authorities));
-	$moby .= "<moby:serviceNotes>".join("", @exceptions)."</moby:serviceNotes>" if (scalar(@exceptions));
+	$moby .= "<moby:serviceNotes xmlns:moby='$WSRF::Constants::MOBY_MESSAGE_NS'>".join("", @exceptions)."</moby:serviceNotes>" if (scalar(@exceptions));
 	$moby .= join("", @queries) if (scalar(@queries));
 	$moby .= responseFooter();
 	

===================================================================
RCS file: /home/repository/moby/moby-live/Perl/MOBY/Async/SimpleServer.pm,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- /home/repository/moby/moby-live/Perl/MOBY/Async/SimpleServer.pm	2007/04/02 12:13:32	1.3
+++ /home/repository/moby/moby-live/Perl/MOBY/Async/SimpleServer.pm	2007/07/18 10:47:24	1.4
@@ -6,8 +6,15 @@
 
 =head1 AUTHORS
 
+Former developer
 Enrique de Andres Saiz (enrique.deandres at pcm.uam.es) -
-INB GNHC-1 (Madrid Science Park, Spain).
+INB GNHC-1 (Madrid Science Park, Spain) (2006-2007).
+
+Maintainers
+Jose Maria Fernandez (jmfernandez at cnio.es),
+Jose Manuel Rodriguez (jmrodriguez at cnio.es) - 
+INB GN2 (CNIO, Spain).
+
 
 =head1 DESCRIPTION
 
@@ -108,14 +115,18 @@
 	# Create an EndpointReference for the resource
 	my $EPR = WSRF::WS_Address->new();
 	$EPR->Address("http://".$ENV{SERVER_NAME}.$ENV{SCRIPT_NAME});
-	$EPR->ReferenceParameters('<wsa:ReferenceParameters><moby:ServiceInvocationId xmlns:moby="'.$WSRF::Constants::MOBY.'">'.$ENV{ID}.'</moby:ServiceInvocationId></wsa:ReferenceParameters>');
+	$EPR->ReferenceParameters('<wsa:ReferenceParameters><mobyws:ServiceInvocationId xmlns:mobyws="'.$WSRF::Constants::MOBY.'">'.$ENV{ID}.'</mobyws:ServiceInvocationId></wsa:ReferenceParameters>');
 	$EPR = XML::LibXML->new->parse_string($EPR->XML)->getDocumentElement->toString;
 	
 	# Write the properties to a file
 	WSRF::File::toFile($ID);
 	
 	# Return the EndpointReference
-	return WSRF::Header::header($envelope), SOAP::Data->value($EPR)->type('xml');
+	return WSRF::Header::header($envelope), SOAP::Data->uri($WSRF::Constants::MOBY)
+						->name('body' => \SOAP::Data->value(
+							SOAP::Data->type('xml'=>$EPR)
+							)
+						);
 };
 
 #===============================================================================
@@ -142,14 +153,14 @@
 	my $moby = $doc->getDocumentElement();
 	
 	# Get authority
-	my @mobyContents = ($moby->getChildrenByTagName('mobyContent'), $moby->getChildrenByTagName('moby:mobyContent'));
+	my @mobyContents = ($moby->getChildrenByTagNameNS($WSRF::Constants::MOBY_MESSAGE_NS,'mobyContent'));
 	my $mobyContent = shift(@mobyContents);
-	my $auth = $mobyContent->getAttribute('authority') || $mobyContent->getAttribute('moby:authority');
+	my $auth = $mobyContent->getAttribute('authority') || $mobyContent->getAttributeNS($WSRF::Constants::MOBY_MESSAGE_NS,'authority');
 	
 	# Get mobyData and iterate over them in order to run the service for each one
-	my @mobyData = ($moby->getElementsByTagName('mobyData'), $moby->getElementsByTagName('moby:mobyData'));
+	my @mobyData = ($moby->getElementsByTagNameNS($WSRF::Constants::MOBY_MESSAGE_NS,'mobyData'));
 	foreach my $mobyData (@mobyData) {
-		my $queryID = $mobyData->getAttribute('queryID') || $mobyData->getAttribute('moby:queryID');
+		my $queryID = $mobyData->getAttribute('queryID') || $mobyData->getAttributeNS($WSRF::Constants::MOBY_MESSAGE_NS,'queryID');
 		my $property_pid    = "pid_$queryID";
 		my $property_input  = "input_$queryID";
 		my $property_status = "status_$queryID";
@@ -183,7 +194,7 @@
 				# Result
 				my $result;
 				$result  = responseHeader($ENV{AUTHURI});
-				$result .= "<serviceNotes><mobyException refQueryID=\'$queryID\' severity=\'error\'>";
+				$result .= "<serviceNotes xmlns='$WSRF::Constants::MOBY_MESSAGE_NS'><mobyException refQueryID=\'$queryID\' severity=\'error\'>";
 				$result .= "<exceptionCode>701</exceptionCode>";
 				$result .= "<exceptionMessage>Unable to submit job.</exceptionMessage>";
 				$result .= "</mobyException>";
@@ -264,9 +275,25 @@
 				my $result;
 				eval {
 					my $xml = $func->($class, $input);
-					my $parser = XML::LibXML->new();
-					my $doc = $parser->parse_string($xml->value);
-					$result = $doc->getDocumentElement->toString;
+					if(UNIVERSAL::isa($xml,'XML::LibXML::Node')) {
+						if(UNIVERSAL::isa($xml,'XML::LibXML::Document')) {
+							$result=$xml->getDocumentElement()->toString();
+						} else {
+							$result=$xml->toString();
+						}
+					} else {
+						my $parser = XML::LibXML->new();
+						my $toparse;
+						if(ref(\$xml) eq 'SCALAR') {
+							$toparse=$xml;
+						} elsif(UNIVERSAL::isa($xml,'SOAP::Data')) {
+							$toparse=$xml->value();
+						} else {
+							die "FATAL ERROR: Unable to handle result type ".ref($xml);
+						}
+						my $doc = $parser->parse_string($toparse);
+						$result = $doc->getDocumentElement()->toString();
+					}
 				};
 				
 				# Check if there has been errors during service execution
@@ -294,7 +321,7 @@
 					
 					# Result
 					$result  = responseHeader($ENV{AUTHURI});
-					$result .= "<serviceNotes><mobyException refQueryID=\'$queryID\' severity=\'error\'>";
+					$result .= "<serviceNotes xmlns='$WSRF::Constants::MOBY_MESSAGE_NS'><mobyException refQueryID=\'$queryID\' severity=\'error\'>";
 					$result .= "<exceptionCode>701</exceptionCode>";
 					$result .= "<exceptionMessage>Error while executing job.</exceptionMessage>";
 					$result .= "</mobyException>";
@@ -304,7 +331,7 @@
 				}
 				
 				# New properties values
-				my $lock = WSRF::MobyFile->new($envelope);
+				$lock = WSRF::MobyFile->new($envelope);
 				$WSRF::WSRP::Private{$property_pid} = '';
 				$WSRF::WSRP::ResourceProperties{$property_status} = $status->XML();
 				$WSRF::WSRP::ResourceProperties{$property_result} = $result;
@@ -317,7 +344,7 @@
 	}
 	
 	# Compose response using the status properties
-	my $lock = WSRF::MobyFile->new($envelope);
+	$lock = WSRF::MobyFile->new($envelope);
 	my $ans = '';
 	foreach my $queryID (@queryIDs) {
 		my $property_status = "status_$queryID";
@@ -333,7 +360,11 @@
 	$lock->toFile();
 	
 	# Return status properties
-	return WSRF::Header::header($envelope), SOAP::Data->value($ans)->type('xml');
+#	return WSRF::Header::header($envelope), SOAP::Data->uri($WSRF::Constants::MOBY)
+#						->name('body' => \SOAP::Data->value(
+#							SOAP::Data->type('xml'=>$ans)
+#						));
+	return WSRF::Header::header($envelope), SOAP::Data->type('xml'=>$ans);
 };
 
 #===============================================================================
@@ -372,7 +403,7 @@
 		}
 		
 		$ans .= responseHeader($ENV{AUTHURI});
-		$ans .= "<serviceNotes>$exception</serviceNotes>";
+		$ans .= "<serviceNotes xmlns='$WSRF::Constants::MOBY_MESSAGE_NS'>$exception</serviceNotes>";
 		$ans .= $response;
 		$ans .= responseFooter();
 		$ans  = SOAP::Data->value($ans)->type('string');
@@ -407,7 +438,7 @@
 	
 	my $ans;
 	$ans .= responseHeader($ENV{AUTHURI});
-	$ans .= "<serviceNotes>$exception</serviceNotes>";
+	$ans .= "<serviceNotes xmlns='$WSRF::Constants::MOBY_MESSAGE_NS'>$exception</serviceNotes>";
 	$ans .= $response;
 	$ans .= responseFooter();
 	
@@ -421,6 +452,11 @@
 #
 sub async {
 	my $wsa = $async_create->(@_);
+	# The specification says that async always work
+	# so any error related to job creation must
+	# be got using poll.
+	# That's the reason why we are ignoring the returned
+	# value from $async_submit
 	$async_submit->(@_);
 	return $wsa;
 }
@@ -433,7 +469,7 @@
 sub Destroy {
 	my ($class, $envelope) = ($_[0], $_[$#_]);
 	
-	$ENV{ID} = $envelope->valueof("/Envelope/Header/ServiceInvocationId");
+	$ENV{ID} = $envelope->valueof("/{$SOAP::Constants::NS_ENV}Envelope/{$SOAP::Constants::NS_ENV}Header/{$WSRF::Constants::MOBY}ServiceInvocationId");
 	my $lock = WSRF::MobyFile->new($envelope);
 	$lock->toFile();
 	

===================================================================
RCS file: /home/repository/moby/moby-live/Perl/MOBY/Async/WSRF.pm,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- /home/repository/moby/moby-live/Perl/MOBY/Async/WSRF.pm	2007/04/02 12:13:32	1.2
+++ /home/repository/moby/moby-live/Perl/MOBY/Async/WSRF.pm	2007/07/18 10:47:24	1.3
@@ -6,8 +6,14 @@
 
 =head1 AUTHORS
 
+Former developer
 Enrique de Andres Saiz (enrique.deandres at pcm.uam.es) -
-INB GNHC-1 (Madrid Science Park, Spain).
+INB GNHC-1 (Madrid Science Park, Spain) (2006-2007).
+
+Maintainers
+Jose Maria Fernandez (jmfernandez at cnio.es),
+Jose Manuel Rodriguez (jmrodriguez at cnio.es) - 
+INB GN2 (CNIO, Spain).
 
 =head1 DESCRIPTION
 
@@ -29,12 +35,13 @@
 
 $WSRF::Constants::Data  = '/tmp/moby_';
 $WSRF::Constants::MOBY  = 'http://biomoby.org/';
+$WSRF::Constants::MOBY_MESSAGE_NS  = 'http://www.biomoby.org/moby';
 $WSRF::Constants::WSA   = 'http://www.w3.org/2005/08/addressing';
 $WSRF::Constants::WSRP  = 'http://docs.oasis-open.org/wsrf/rp-2';
 $WSRF::Constants::WSRL  = 'http://docs.oasis-open.org/wsrf/rl-2';
 $WSRF::Constants::WSSG  = 'http://docs.oasis-open.org/wsrf/sg-2';
 $WSRF::Constants::WSBF  = 'http://docs.oasis-open.org/wsrf/bf-2';
-$WSRF::Constants::WSA_ANON = 'http://www.w3.org/2005/03/addressing/role/anonymous';
+$WSRF::Constants::WSA_ANON = 'http://www.w3.org/2005/08/addressing/anonymous';
 
 #===============================================================================
 # WSRF::Serializer
@@ -200,11 +207,11 @@
 	my $self = shift @_;
 	my $envelope = pop @_;
 	
-	$ENV{ID} = $envelope->valueof("/Envelope/Header/ServiceInvocationId");
+	$ENV{ID} = $envelope->valueof("/{$SOAP::Constants::NS_ENV}Envelope/{$SOAP::Constants::NS_ENV}Header/{$WSRF::Constants::MOBY}ServiceInvocationId");
 	my $lock = WSRF::MobyFile->new($envelope);
 	$lock->toFile();
 	
-	my $search = $envelope->valueof('//GetResourceProperty/');
+	my $search = $envelope->valueof("//{$WSRF::Constants::WSRP}GetResourceProperty/");
 	WSRF::BaseFaults::die_with_fault( $envelope, (
 		BaseFault   => "InvalidResourcePropertyQNameFault",
 		Description => "Property $search does not exist"
@@ -220,12 +227,12 @@
 	my $self = shift @_;
 	my $envelope = pop @_;
 	
-	$ENV{ID} = $envelope->valueof("/Envelope/Header/ServiceInvocationId");
+	$ENV{ID} = $envelope->valueof("/{$SOAP::Constants::NS_ENV}Envelope/{$SOAP::Constants::NS_ENV}Header/{$WSRF::Constants::MOBY}ServiceInvocationId");
 	my $lock = WSRF::MobyFile->new($envelope); 
 	$lock->toFile();
 	
 	my @notfound;
-	foreach my $search ($envelope->valueof('//ResourceProperty/')) {
+	foreach my $search ($envelope->valueof("//{$WSRF::Constants::WSRP}ResourceProperty/")) {
 		push(@notfound, $search) unless (defined($WSRF::WSRP::ResourceProperties{$search}));
 	}
 	WSRF::BaseFaults::die_with_fault( $envelope, (
@@ -253,7 +260,7 @@
 use vars qw(@ISA);
 @ISA = qw(WSRF::FileBasedMobyResourceProperties);
 
-# Add reource property TerminationTime - initalise to nothing (infinity).
+# Add resource property TerminationTime - initalise to nothing (infinity).
 $WSRF::WSRP::ResourceProperties{'TerminationTime'} = '';
 $WSRF::WSRP::PropertyNamespaceMap->{TerminationTime}{prefix} = "wsrl";
 $WSRF::WSRP::Nillable{TerminationTime} = 1;
@@ -273,7 +280,7 @@
 sub Destroy {
 	my $self = shift @_;
 	my $envelope = pop @_;
-	$ENV{ID} = $envelope->valueof("/Envelope/Header/ServiceInvocationId");
+	$ENV{ID} = $envelope->valueof("/{$SOAP::Constants::NS_ENV}Envelope/{$SOAP::Constants::NS_ENV}Header/{$WSRF::Constants::MOBY}ServiceInvocationId");
 	my $lock = WSRF::MobyFile->new($envelope);
 	my $file = $WSRF::Constants::Data.$lock->ID();
 	unlink $file or WSRF::BaseFaults::die_with_fault( $envelope, (
@@ -390,8 +397,8 @@
 	if (defined($args{From})) {
 		$myHeader .= "<wsa:From wsu:Id=\"From\">".$args{From}."</wsa:From>";
 	} else {
-		if ( $envelope->match("/Envelope/Header/{$WSRF::Constants::WSA}To") ) {   
-			my $from = $envelope->valueof("/Envelope/Header/{$WSRF::Constants::WSA}To");   
+		if ( $envelope->match("/{$SOAP::Constants::NS_ENV}Envelope/{$SOAP::Constants::NS_ENV}Header/{$WSRF::Constants::WSA}To") ) {   
+			my $from = $envelope->valueof("/{$SOAP::Constants::NS_ENV}Envelope/{$SOAP::Constants::NS_ENV}Header/{$WSRF::Constants::WSA}To");   
 			$myHeader .= "<wsa:From wsu:Id=\"From\"><wsa:Address>$from</wsa:Address></wsa:From>";
 		}
 	}
@@ -407,7 +414,7 @@
 	if (defined($args{Action})) {
 		$myHeader .= "<wsa:Action wsu:Id=\"Action\">".$args{Action}."</wsa:Action>";
 	} else {
-		my $data = $envelope->match('/Envelope/Body/[1]')->dataof;
+		my $data = $envelope->match("/{$SOAP::Constants::NS_ENV}Envelope/{$SOAP::Constants::NS_ENV}Body/[1]")->dataof;
 		my $method = $data->name;
 		my $uri = $data->uri;
 		$myHeader .= "<wsa:Action wsu:Id=\"Action\">".$uri."/".$method."Response</wsa:Action>";
@@ -488,7 +495,7 @@
 		}
 		foreach my $propertyPrefix (@{$WSRF::WSRP::MobyPropertiesPrefixes}) {
 			$WSRF::WSRP::ResourceProperties{$propertyPrefix.'_'.$queryID} = $WSRF::WSRP::ResourceProperties{$propertyPrefix.'_'.$queryID} || '';
-			$WSRF::WSRP::PropertyNamespaceMap->{$propertyPrefix.'_'.$queryID}{prefix} = 'moby';
+			$WSRF::WSRP::PropertyNamespaceMap->{$propertyPrefix.'_'.$queryID}{prefix} = 'mobyws';
 			$WSRF::WSRP::PropertyNamespaceMap->{$propertyPrefix.'_'.$queryID}{namespace} = $WSRF::Constants::MOBY;
 			$WSRF::WSRP::NotDeletable{$propertyPrefix.'_'.$queryID} = 1;
 			$WSRF::WSRP::NotModifiable{$propertyPrefix.'_'.$queryID} = 1;




More information about the MOBY-guts mailing list