r2056 - in packages/soap-lite/branches/upstream/current: . lib/SOAP lib/SOAP/Transport t

Krzysztof Krzyzaniak eloy at costa.debian.org
Sat Jan 28 22:36:03 UTC 2006


Author: eloy
Date: 2006-01-28 22:36:02 +0000 (Sat, 28 Jan 2006)
New Revision: 2056

Modified:
   packages/soap-lite/branches/upstream/current/META.yml
   packages/soap-lite/branches/upstream/current/lib/SOAP/Lite.pm
   packages/soap-lite/branches/upstream/current/lib/SOAP/Packager.pm
   packages/soap-lite/branches/upstream/current/lib/SOAP/Transport/HTTP.pm
   packages/soap-lite/branches/upstream/current/t/01-core.t
Log:
Load /tmp/tmp.Q9Qo9S/soap-lite-0.67 into
packages/soap-lite/branches/upstream/current.


Modified: packages/soap-lite/branches/upstream/current/META.yml
===================================================================
--- packages/soap-lite/branches/upstream/current/META.yml	2006-01-23 06:13:13 UTC (rev 2055)
+++ packages/soap-lite/branches/upstream/current/META.yml	2006-01-28 22:36:02 UTC (rev 2056)
@@ -1,7 +1,7 @@
 # http://module-build.sourceforge.net/META-spec.html
 #XXXXXXX This is a prototype!!!  It will change in the future!!! XXXXX#
 name:         SOAP-Lite
-version:      0.66.1
+version:      0.67
 version_from: lib/SOAP/Lite.pm
 installdirs:  site
 requires:

Modified: packages/soap-lite/branches/upstream/current/lib/SOAP/Lite.pm
===================================================================
--- packages/soap-lite/branches/upstream/current/lib/SOAP/Lite.pm	2006-01-23 06:13:13 UTC (rev 2055)
+++ packages/soap-lite/branches/upstream/current/lib/SOAP/Lite.pm	2006-01-28 22:36:02 UTC (rev 2056)
@@ -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,v 1.38 2006/01/04 23:01:06 byrnereese Exp $
+# $Id: Lite.pm,v 1.39 2006/01/27 21:31:57 byrnereese Exp $
 #
 # ======================================================================
 
@@ -15,7 +15,7 @@
 use vars qw($VERSION);
 #$VERSION = sprintf("%d.%s", map {s/_//g; $_} q$Name:  $ =~ /-(\d+)_([\d_]+)/)
 #  or warn "warning: unspecified/non-released version of ", __PACKAGE__, "\n";
-$VERSION = '0.66.1';
+$VERSION = '0.67';
 
 # ======================================================================
 
@@ -832,10 +832,10 @@
     my $self = shift->new;
     if (@_) {
 	my ($u,$p) = @_;
-	$self->register_ns($u);
 	$self->{'_ns_uri'}         = $u;
 	$self->{'_ns_prefix'}      = $p ? $p : $self->gen_ns;
 	$self->{'_use_default_ns'} = 0;
+	$self->register_ns($u,$self->{'_ns_prefix'});
 	return $self;
     }
     return $self->{'_ns_uri'};
@@ -855,10 +855,10 @@
 
 sub use_prefix {
   my $self = shift->new;
-#  warn 'use_prefix has been deprecated. if you wish to turn off or on the use of a default namespace, then please use either ns(uri) or default_ns(uri)';
+  warn 'use_prefix has been deprecated. if you wish to turn off or on the use of a default namespace, then please use either ns(uri) or default_ns(uri)';
   if (@_) {
       my $use = shift;
-      $self->{'_use_default_ns'} = !$use;
+      $self->{'_use_default_ns'} = !$use || 0;
       return $self;
   } else {
       return $self->{'_use_default_ns'};
@@ -880,8 +880,14 @@
   my $self = shift->new;
 #  warn 'uri has been deprecated. if you wish to set the namespace for the request, then please use either ns(uri) or default_ns(uri)';
   if (@_) {
-      $self->{'_ns_uri'} = shift;
-      $self->register_ns($self->{'_ns_uri'}) if (!$self->use_prefix);
+      my $ns = shift;
+      if ($self->{_use_default_ns}) {
+	  $self->default_ns($ns);
+      } else {
+	  $self->ns($ns);
+      }
+#      $self->{'_ns_uri'} = $ns;
+#      $self->register_ns($self->{'_ns_uri'}) if (!$self->{_use_default_ns});
       return $self;
   }
   return $self->{'_ns_uri'};
@@ -1445,8 +1451,15 @@
     if (!defined($method)) {
     } elsif (UNIVERSAL::isa($method => 'SOAP::Data')) {
       $body = $method;
-    } elsif (!$self->use_default_ns) {
-
+    } elsif ($self->use_default_ns) {
+      if ($self->{'_ns_uri'}) {
+        $body = SOAP::Data->name($method)->attr( { 
+	    'xmlns' => $self->{'_ns_uri'},
+	} ); 
+      } else {
+        $body = SOAP::Data->name($method); 
+      }
+    } else {
 # Commented out by Byrne on 1/4/2006 - to address default namespace problems
 #      $body = SOAP::Data->name($method)->uri($self->{'_ns_uri'});
 #      $body = $body->prefix($self->{'_ns_prefix'}) if ($self->{'_ns_prefix'});
@@ -1459,14 +1472,6 @@
       $body = $body->prefix($pre) if ($self->{'_ns_prefix'});
 # End new code
 
-    } else {
-      if ($self->{'_ns_uri'}) {
-        $body = SOAP::Data->name($method)->attr( { 
-	    'xmlns' => $self->{'_ns_uri'},
-	} ); 
-      } else {
-        $body = SOAP::Data->name($method); 
-      }
     }
     # This is breaking a unit test right now...
     $body->set_value(SOAP::Utils::encode_data($parameters ? \$parameters : ()))

Modified: packages/soap-lite/branches/upstream/current/lib/SOAP/Packager.pm
===================================================================
--- packages/soap-lite/branches/upstream/current/lib/SOAP/Packager.pm	2006-01-23 06:13:13 UTC (rev 2055)
+++ packages/soap-lite/branches/upstream/current/lib/SOAP/Packager.pm	2006-01-28 22:36:02 UTC (rev 2056)
@@ -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: Packager.pm,v 1.4 2004/10/26 15:26:49 byrnereese Exp $
+# $Id: Packager.pm,v 1.6 2006/01/27 20:45:36 byrnereese Exp $
 #
 # ======================================================================
 
@@ -208,8 +208,14 @@
   my ($entity) = @_;
   die "Multipart MIME messages MUST declare Multipart/Related content-type"
     if ($entity->head->mime_attr('content-type') !~ /^multipart\/related/i);
-  my $start = get_multipart_id($entity->head->mime_attr('content-type.start'))
-    || get_multipart_id($entity->parts(0)->head->mime_attr('content-id'));
+  # As it turns out, the Content-ID and start parameters are optional
+  # according to the MIME and SOAP specs. In the event that the head cannot
+  # be found, the head/root entity is used as a starting point.
+  my $start = get_multipart_id($entity->head->mime_attr('content-type.start'));
+  if (!defined($start) || $start eq "") {
+      $start = $self->generate_random_string(10);
+      $entity->parts(0)->head->add('content-id',$start);
+  }
   my $location = $entity->head->mime_attr('content-location') ||
     'thismessage:/';
   my $env;
@@ -237,8 +243,8 @@
       $self->push_part($part) if (defined($part->bodyhandle));
     }
   }
-  die "Can't find 'start' parameter in multipart MIME message\n"
-    if @{$self->parts} > 1 && !$start;
+#  die "Can't find 'start' parameter in multipart MIME message\n"
+#    if @{$self->parts} > 1 && !$start;
   return $env;
 }
 

Modified: packages/soap-lite/branches/upstream/current/lib/SOAP/Transport/HTTP.pm
===================================================================
--- packages/soap-lite/branches/upstream/current/lib/SOAP/Transport/HTTP.pm	2006-01-23 06:13:13 UTC (rev 2055)
+++ packages/soap-lite/branches/upstream/current/lib/SOAP/Transport/HTTP.pm	2006-01-28 22:36:02 UTC (rev 2056)
@@ -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: HTTP.pm,v 1.16 2005/10/19 00:43:23 byrnereese Exp $
+# $Id: HTTP.pm,v 1.17 2006/01/27 21:30:38 byrnereese Exp $
 #
 # ======================================================================
 
@@ -183,9 +183,11 @@
 			   $SOAP::Constants::DEFAULT_HTTP_CONTENT_TYPE,
 			   !$SOAP::Constants::DO_NOT_USE_CHARSET && $encoding ?
 			   'charset=' . lc($encoding) : ());
-      }elsif (!$SOAP::Constants::DO_NOT_USE_CHARSET && $encoding ){
+      } elsif (!$SOAP::Constants::DO_NOT_USE_CHARSET && $encoding ){
 	my $tmpType = $self->http_request->headers->header('Content-type');
-	$self->http_request->content_type($tmpType.'; charset=' . lc($encoding));
+#	$self->http_request->content_type($tmpType.'; charset=' . lc($encoding));
+        my $addition = '; charset=' . lc($encoding);
+        $self->http_request->content_type($tmpType.$addition) if ($tmpType !~ /$addition/);
       }
 
       $self->http_request->content_length($bytelength);

Modified: packages/soap-lite/branches/upstream/current/t/01-core.t
===================================================================
--- packages/soap-lite/branches/upstream/current/t/01-core.t	2006-01-23 06:13:13 UTC (rev 2055)
+++ packages/soap-lite/branches/upstream/current/t/01-core.t	2006-01-28 22:36:02 UTC (rev 2056)
@@ -22,13 +22,14 @@
   ok($@ =~ /99\.99 required/);
 }
 
+# These tests are for backwards compatibility
 { # check use of use_prefix and uri together
   # test 2 - turn OFF default namespace
   $SIG{__WARN__} = sub { ; }; # turn off deprecation warnings
   $serialized = SOAP::Serializer->use_prefix(1)->uri("urn:Test")->method(
     'testMethod', SOAP::Data->name(test => 123)
   );
-  ok($serialized =~ m!<soap:Body><namesp(\d):testMethod xmlns:namesp\1="urn:Test"><test xsi:type="xsd:int">123</test></namesp\1:testMethod></soap:Body>!);
+  ok($serialized =~ m!<soap:Body><namesp(\d):testMethod><test xsi:type="xsd:int">123</test></namesp\1:testMethod></soap:Body>!);
 
   # test 3 - turn ON default namespace
   $serialized = SOAP::Serializer->use_prefix(0)->uri("urn:Test")->method(
@@ -42,12 +43,12 @@
   $serialized = SOAP::Serializer->ns("urn:Test")->method(
     'testMethod', SOAP::Data->name(test => 123)
   );
-  ok($serialized =~ m!<namesp(\d):testMethod xmlns:namesp\1="urn:Test"><test xsi:type="xsd:int">123</test></namesp\1:testMethod>!);
+  ok($serialized =~ m!<namesp(\d):testMethod><test xsi:type="xsd:int">123</test></namesp\1:testMethod>!);
 
   $serialized = SOAP::Serializer->ns("urn:Test","testns")->method(
     'testMethod', SOAP::Data->name(test => 123)
   );
-  ok($serialized =~ m!<testns:testMethod xmlns:testns="urn:Test"><test xsi:type="xsd:int">123</test></testns:testMethod>!);
+  ok($serialized =~ m!<testns:testMethod><test xsi:type="xsd:int">123</test></testns:testMethod>!);
 
   $serialized = SOAP::Serializer->default_ns("urn:Test")->method(
     'testMethod', SOAP::Data->name(test => 123)




More information about the Pkg-perl-cvs-commits mailing list