[interchange-cvs] interchange - racke modified lib/Vend/SOAP.pm

interchange-core@icdevgroup.org interchange-core@icdevgroup.org
Mon Jun 23 11:00:00 2003


User:      racke
Date:      2003-06-23 14:59:14 GMT
Modified:  lib/Vend SOAP.pm
Log:
fixed tree option in soap_entity tag
enable calling of catalog usertags in SOAP actions

Revision  Changes    Path
2.14      +11 -5     interchange/lib/Vend/SOAP.pm


rev 2.14, prev_rev 2.13
Index: SOAP.pm
===================================================================
RCS file: /anon_cvs/repository/interchange/lib/Vend/SOAP.pm,v
retrieving revision 2.13
retrieving revision 2.14
diff -u -r2.13 -r2.14
--- SOAP.pm	18 Jun 2003 17:34:44 -0000	2.13
+++ SOAP.pm	23 Jun 2003 14:59:14 -0000	2.14
@@ -1,6 +1,6 @@
 # Vend::SOAP - Handle SOAP connections for Interchange
 #
-# $Id: SOAP.pm,v 2.13 2003/06/18 17:34:44 jon Exp $
+# $Id: SOAP.pm,v 2.14 2003/06/23 14:59:14 racke Exp $
 #
 # Copyright (C) 2002-2003 Interchange Development Group
 # Copyright (C) 2000-2002 Red Hat, Inc.
@@ -35,7 +35,7 @@
 use strict;
 
 use vars qw($VERSION @ISA $AUTOLOAD);
-$VERSION = substr(q$Revision: 2.13 $, 10);
+$VERSION = substr(q$Revision: 2.14 $, 10);
 @ISA = qw/SOAP::Server/;
 
 my %Allowed_tags;
@@ -172,11 +172,16 @@
 sub tag_soap_entity {
 	my ($opt) = @_;
 	my ($obj);
-        
+
 	if ($opt->{tree}) {
-		$opt->{value} = map {tag_soap_entity($_)} @{$opt->{value}};
+		my @values = map {tag_soap_entity($_)} @{$opt->{value}};
+		$opt->{value} = \@values;
+	}
+	eval {$obj = new SOAP::Data (%$opt);};
+	if ($@) {
+		logError ("soap_entity failed: $@");
+		return;
 	}
-	$obj = new SOAP::Data (%$opt);
 	return $obj;
 }
 
@@ -382,6 +387,7 @@
 		$sub = $Vend::Cfg->{SOAP_Action}{$routine};
 		Vend::Interpolate::init_calc();
 		new Vend::Tags;
+		new Vend::Parse;	# enable catalog usertags within SOAP actions
 	} elsif (! $Allowed_tags{$routine}) {
 		die ::errmsg("Not allowed routine: %s", $routine);
 	} else {