Diff of /branches/0.71/lib/SOAP/Lite.pm [r403] .. [r404]  Maximize  Restore

Switch to side-by-side view

--- a/branches/0.71/lib/SOAP/Lite.pm
+++ b/branches/0.71/lib/SOAP/Lite.pm
@@ -4,7 +4,7 @@
 # SOAP::Lite is free software; you can redistribute it
 # and/or modify it under the same terms as Perl itself.
 #
-# $Id: Lite.pm 400 2012-03-10 16:45:03Z kutterma $
+# $Id: Lite.pm 404 2012-03-11 08:58:49Z kutterma $
 #
 # ======================================================================
 
@@ -609,12 +609,12 @@
 }
 
 sub type {
-    my $self = ref $_[0] 
-		? shift
-		: UNIVERSAL::isa($_[0] => __PACKAGE__)
-			? shift->new()
-			: __PACKAGE__->new();
-	if (@_) {
+    my $self = ref $_[0]
+        ? shift
+        : UNIVERSAL::isa($_[0] => __PACKAGE__)
+            ? shift->new()
+            : __PACKAGE__->new();
+    if (@_) {
         $self->{_type} = shift;
         $self->value(@_) if @_;
         return $self;
@@ -667,25 +667,25 @@
 }
 
 sub prefix {
-    my $self = ref $_[0] 
-		? shift 
-		: UNIVERSAL::isa($_[0] => __PACKAGE__)
-			? shift->new()
-			: __PACKAGE__->new();
+    my $self = ref $_[0]
+        ? shift
+        : UNIVERSAL::isa($_[0] => __PACKAGE__)
+            ? shift->new()
+            : __PACKAGE__->new();
     return $self->{_prefix} unless @_;
     $self->{_prefix} = shift;
     if (scalar @_) {
-		return $self->value(@_);
-	}
+        return $self->value(@_);
+    }
     return $self;
 }
 
 sub uri {
     my $self = ref $_[0]
         ? shift
-	    : UNIVERSAL::isa($_[0] => __PACKAGE__)
-	        ? shift->new()
-		    : __PACKAGE__->new();
+        : UNIVERSAL::isa($_[0] => __PACKAGE__)
+            ? shift->new()
+            : __PACKAGE__->new();
     return $self->{_uri} unless @_;
     my $uri = $self->{_uri} = shift;
     warn "Usage of '::' in URI ($uri) deprecated. Use '/' instead\n"
@@ -697,28 +697,28 @@
 }
 
 sub set_value {
-    my $self = ref $_[0] 
-		? shift
-		: UNIVERSAL::isa($_[0] => __PACKAGE__)
-			? shift->new()
-			: __PACKAGE__->new();
+    my $self = ref $_[0]
+        ? shift
+        : UNIVERSAL::isa($_[0] => __PACKAGE__)
+            ? shift->new()
+            : __PACKAGE__->new();
     $self->{_value} = [@_];
     return $self;
 }
 
 sub value {
     my $self = ref $_[0] ? shift
-		: UNIVERSAL::isa($_[0] => __PACKAGE__)
-			? shift->new()
-			: __PACKAGE__->new;
+        : UNIVERSAL::isa($_[0] => __PACKAGE__)
+            ? shift->new()
+            : __PACKAGE__->new;
     if (@_) {
-		return $self->set_value(@_);
-	}
-	else {
-		return wantarray
+        return $self->set_value(@_);
+    }
+    else {
+        return wantarray
             ? @{$self->{_value}}
             : $self->{_value}->[0];
-	}
+    }
 }
 
 sub signature {
@@ -866,13 +866,13 @@
 }
 
 sub typelookup {
-	my ($self, $lookup) = @_;
-	if (defined $lookup) {
-		$self->{ _typelookup } = $lookup;
-		$self->{ _typelookup_order } = [ sort { $lookup->{$a}->[0] <=> $lookup->{$b}->[0] } keys %{ $lookup } ];
-		return $self;
-	}
-	return $self->{ _typelookup };
+    my ($self, $lookup) = @_;
+    if (defined $lookup) {
+        $self->{ _typelookup } = $lookup;
+        $self->{ _typelookup_order } = [ sort { $lookup->{$a}->[0] <=> $lookup->{$b}->[0] } keys %{ $lookup } ];
+        return $self;
+    }
+    return $self->{ _typelookup };
 }
 
 sub ns {
@@ -1038,20 +1038,20 @@
     my ($self, $object) = @_;
     my $id = $self->gen_id($object);
     if (! exists $self->{ _seen }->{ $id }) {
-		$self->{ _seen }->{ $id } = {
-			count => 1,
-			multiref => 0,
-			value => $object,
-			recursive => 0
-		};
-	}
-	else {
-		my $id_seen = $self->{ _seen }->{ $id };
-		$id_seen->{count}++;
-		$id_seen->{multiref} = 1;
-		$id_seen->{value} = $object;
-		$id_seen->{recursive} ||= 0;
-	}
+        $self->{ _seen }->{ $id } = {
+            count => 1,
+            multiref => 0,
+            value => $object,
+            recursive => 0
+        };
+    }
+    else {
+        my $id_seen = $self->{ _seen }->{ $id };
+        $id_seen->{count}++;
+        $id_seen->{multiref} = 1;
+        $id_seen->{value} = $object;
+        $id_seen->{recursive} ||= 0;
+    }
     return $id;
 }
 
@@ -1210,7 +1210,7 @@
         no strict qw(refs);
         #for (sort {$lookup->{$a}->[0] <=> $lookup->{$b}->[0]} keys %$lookup) {
         for (@{ $self->{ _typelookup_order } }) {
-		    my $method = $lookup->{$_}->[2];
+            my $method = $lookup->{$_}->[2];
             return $self->can($method) && $self->$method($value, $name, $type, $attr)
                 || $method->($value, $name, $type, $attr)
                     if $lookup->{$_}->[1]->($value);
@@ -1447,10 +1447,10 @@
 
 sub tag {
     my ($self, $tag, $attrs, @values) = @_;
-    
-	my $readable = $self->{ _readable };
-	
-	my $value = join '', @values;
+
+    my $readable = $self->{ _readable };
+
+    my $value = join '', @values;
     my $indent = $readable ? ' ' x (($self->{ _level }-1)*2) : '';
 
     # check for special attribute
@@ -1496,7 +1496,7 @@
         unless defined $values;
 
     return $self->tag($name, $attrs, $values)
-        unless ref $values eq "ARRAY"; 
+        unless ref $values eq "ARRAY";
 
     return $self->tag($name, {%$attrs, href => '#'.$self->multiref_anchor($id)})
         if $self->is_href($id, delete($attrs->{_id}));
@@ -1992,11 +1992,11 @@
     return $pointer unless defined $path;
 
     if (! $op) {
-	    $op = '=='; 
-	}
-	elsif ($op eq '=' || $op eq '!') {
-		$op .= '='; 
-	}
+        $op = '==';
+    }
+    elsif ($op eq '=' || $op eq '!') {
+        $op .= '=';
+    }
     my $numok = defined $num && eval "$itself $op $num";
     my $nameok = (o_lname($pointer) || '') =~ /(?:^|\})$path$/ if defined $path; # name can be with namespace
 
@@ -2177,9 +2177,9 @@
     my $ref = shift;
     my($name, $attrs_ref, $children, $value) = @$ref;
 
-	my %attrs = %{ $attrs_ref };
-
-    $ref->[ _ATTRS ] = \%attrs;		# make a copy for long attributes
+    my %attrs = %{ $attrs_ref };
+
+    $ref->[ _ATTRS ] = \%attrs;        # make a copy for long attributes
 
     use vars qw(%uris);
     local %uris = (%uris, map {
@@ -2242,15 +2242,15 @@
         #        value is valid
         if (defined $encodingStyle && length($encodingStyle)) {
             my %styles = map { $_ => undef } @SOAP::Constants::SUPPORTED_ENCODING_STYLES;
-	        my $found = 0;
+            my $found = 0;
             foreach my $e (split(/ +/,$encodingStyle)) {
-			    if (exists $styles{$e}) {
-				    $found ++;
+                if (exists $styles{$e}) {
+                    $found ++;
             }
-		}
-		die "Unrecognized/unsupported value of encodingStyle attribute '$encodingStyle'"
-			if (! $found) && !(SOAP::Lite->soapversion == 1.1 && $encodingStyle =~ /(?:^|\b)$SOAP::Constants::NS_ENC/);
-	}
+        }
+        die "Unrecognized/unsupported value of encodingStyle attribute '$encodingStyle'"
+            if (! $found) && !(SOAP::Lite->soapversion == 1.1 && $encodingStyle =~ /(?:^|\b)$SOAP::Constants::NS_ENC/);
+    }
     }
     use vars '$arraytype'; # type of Array element specified on Array itself
     # either specified with xsi:type, or <enc:name/> or array element
@@ -2269,14 +2269,14 @@
         if (! Class::Inspector->loaded($schemaclass) ) {
             eval "require $schemaclass" or die $@ if not ref $schemaclass;
         }
-		$_class_loaded{$schemaclass} = undef;
+        $_class_loaded{$schemaclass} = undef;
     }
 
     # store schema that is used in parsed message
     $self->{ _xmlschema } = $schema if ($schema) && $schema =~ /XMLSchema/;
-   
+
    # don't use class/type if anyType/ur-type is specified on wire
-	undef $class
+    undef $class
         if $schemaclass->can('anyTypeValue')
             && $schemaclass->anyTypeValue eq $class;
 
@@ -2310,13 +2310,13 @@
         }
     }
 
-	return undef if grep {
-	    /^$SOAP::Constants::NS_XSI_NILS$/ && do {
-	         my $class = $self->xmlschemas->{ $1 || $2 };
-	         eval "require $class" or die @$;;
-	         $class->as_undef($attrs->{$_})
-		}
-	} keys %$attrs;
+    return undef if grep {
+        /^$SOAP::Constants::NS_XSI_NILS$/ && do {
+             my $class = $self->xmlschemas->{ $1 || $2 };
+             eval "require $class" or die @$;;
+             $class->as_undef($attrs->{$_})
+        }
+    } keys %$attrs;
 
     # try to handle with typecasting
     my $res = $self->typecast($value, $name, $attrs, $children, $type);

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks