[MOBY-guts] biomoby commit

Eddie Kawas kawas at dev.open-bio.org
Thu Feb 8 23:11:34 UTC 2007


kawas
Thu Feb  8 18:11:34 EST 2007
Update of /home/repository/moby/moby-live/Perl/MOBY/SOAP
In directory dev.open-bio.org:/tmp/cvs-serv31408/SOAP

Modified Files:
	Serializer.pm 
Log Message:
fixed the problem where a client calls DUMP and the soap fails to parse. This fix must be extended to the case where SOAP::Data is passed (if that ever happens)
moby-live/Perl/MOBY/SOAP Serializer.pm,1.1,1.2
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/MOBY/SOAP/Serializer.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- /home/repository/moby/moby-live/Perl/MOBY/SOAP/Serializer.pm	2007/02/01 14:15:11	1.1
+++ /home/repository/moby/moby-live/Perl/MOBY/SOAP/Serializer.pm	2007/02/08 23:11:34	1.2
@@ -3,7 +3,7 @@
 
 # this module serializes SOAP messages to ensure
 # compatibility with other soap clients (Java)
-# All that you have to do to make this your serializer, 
+# All that you have to do to make this your serializer,
 # is to uncomment, from MOBY-Central.pl, the line:
 #
 # 	$x->serializer(MOBY::SOAP::Serializer->new);
@@ -12,8 +12,8 @@
 #
 # 	MAKE SURE TO 'use MOBY::SOAP::Serializer;'
 #
-# This ensures that mobycentral is compatible with 
-# SOAP-lite version >= .6  
+# This ensures that mobycentral is compatible with
+# SOAP-lite version >= .6
 @MOBY::SOAP::Serializer::ISA = 'SOAP::Serializer';
 
 sub envelope {
@@ -21,6 +21,7 @@
 	# only 'transform' soap responses
 	UNIVERSAL::isa( $_[3] => 'SOAP::Data' )
 	  ? do {
+
 		# below encodes data
 		#my $xml = $_[3]->value;
 		#$xml =~ s"&"&"g;
@@ -28,20 +29,29 @@
 		#$xml =~ s"\]\]\>"\]\]>"g;
 		#$_[3]->value($xml);
 		# when we set to string, we dont have to encode
-		$_[3]->type( 'string' => $_[3] );
+		#FIXME - this wont work for the DUMP call if and when a SOAP::Data object is passed 
+		$_[3]->type( 'string' => $_[3]->value() );
 	  }
 
 	  : do {
-
-		# below encodes data -> set type to string and we dont have to
-		#$_[3] =~ s"&"&"g;
-		#$_[3] =~ s"\<"&lt;"g;
-		#$_[3] =~ s"\]\]\>"\]\]&gt;"g;
-		# set to string to avoid encoding
-		$_[3] = SOAP::Data->type( 'string' => $_[3] );
+			do {
+				# for dumps, they are of type array: set them accordingly
+				$_[3]->[0] = SOAP::Data->type( 'string' => $_[3]->[0] ) if $_[3]->[0];
+				$_[3]->[1] = SOAP::Data->type( 'string' => $_[3]->[1] ) if $_[3]->[1];
+				$_[3]->[2] = SOAP::Data->type( 'string' => $_[3]->[2] ) if $_[3]->[2];
+				$_[3]->[3] = SOAP::Data->type( 'string' => $_[3]->[3] ) if $_[3]->[3];
+				$_[3]->[4] = SOAP::Data->type( 'string' => $_[3]->[4] ) if $_[3]->[4];	
+			} if ( ref( $_[3] ) eq 'ARRAY' );
+		do {
+			# below encodes data -> set type to string and we dont have to
+			#$_[3] =~ s"&"&amp;"g;
+			#$_[3] =~ s"\<"&lt;"g;
+			#$_[3] =~ s"\]\]\>"\]\]&gt;"g;
+			# set to string to avoid encoding
+			$_[3] = SOAP::Data->type( 'string' => $_[3] );
+		} unless ( ref( $_[3] ) eq 'ARRAY' );
 	  } if $_[1] =~ /^(?:method|response)$/;
-
 	shift->SUPER::envelope(@_);
 }
 
-1;
+1;
\ No newline at end of file




More information about the MOBY-guts mailing list