Skip Menu |

This queue is for tickets about the SOAP-Lite CPAN distribution.

Report information
The Basics
Id: 82416
Status: resolved
Worked: 2.2 hours (130 min)
Priority: 0/
Queue: SOAP-Lite

People
Owner: Nobody in particular
Requestors: MRDVT [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in:
  • 0.710.10
  • 0.715
Fixed in: (no value)

Attachments
patch-0.715-0.716-2013-01-13-Michael_R._Davis-mrdvt92.diff
perl-SOAP-Lite-0.710.10-1_to_-0.710.91-4.patch.zip
perl-SOAP-Lite.spec



Subject: xop href cid: URI encoded support
in sub decode_value (my $id = delete $attrs->{href}) =~ s/^(#|cid:|uuid:)?//; if $id =~m/cid:/ the $id needs to be URL decoded. If the cid: has URL encoded characters we end up at this die die "Unresolved (wrong?) href ($id) in element '$name'\n"; Ref: http://www.w3.org/TR/xop10/ my example <xop:Include xmlns:xop="http://www.w3.org/2004/08/xop/include" href="cid:guid-removed%40www.plm"/> ... Content-ID: <guid-removed@www.plm> Thanks, Mike mrdvt92
On Fri Jan 04 17:06:39 2013, MRDVT wrote: Show quoted text
> die "Unresolved (wrong?) href ($id) in element '$name'\n";
It appears that SOAP::Lite is not the only lib that has this issue. https://issues.jboss.org/browse/JBWS-2405 http://jira.codehaus.org/browse/XFIRE-1152 In the JBOSS ticket Show quoted text
> You're right, Microsoft uses encoded URL strings for attachment ids.
Show quoted text
> In accordance to the following case we have agreed that this is now a
bug https://enterprise.redhat.com/issue-tracker/? module=issues&action=view&tid=279509&gid=1369 If I don't hear back soon, I will have to hack a patch but I'm not a SOAP::Lite pro. Is there a preference of URI decoding packages?
On Wed Jan 09 16:24:57 2013, MRDVT wrote: Show quoted text
> Is there a preference of URI decoding packages?
It looks like URI::Escape wins the war. I'll try to integrate it in my local version shortly and provide a patch.
Show quoted text
> local version shortly and provide a patch.
Attached is patch. The "real" change is only these two lines of code. --- lib/SOAP/Lite.pm (revision 418) +++ lib/SOAP/Lite.pm (working copy) @@ -2298,8 +2299,10 @@ } elsif (exists $attrs->{href}) { (my $id = delete $attrs->{href}) =~ s/^(#|cid:|uuid:)?//; + my $type=$1; + $id=uri_unescape($id) if (defined($type) and $type eq 'cid:'); # convert to absolute if not internal '#' or 'cid:'
Subject: perl-SOAP-Lite.spec
Name: perl-SOAP-Lite Version: 0.716 Release: 1%{?dist} Summary: Client and server side SOAP implementation License: GPL+ or Artistic Group: Development/Libraries URL: http://search.cpan.org/dist/SOAP-Lite/ Source0: http://search.cpan.org/CPAN/authors/id/M/MK/MKUTTER/SOAP-Lite-%{version}.tar.gz #Patch0: perl-SOAP-Lite-0.715-IO-modules.patch BuildArch: noarch # Core package BuildRequires: perl(Class::Inspector) BuildRequires: perl(constant) BuildRequires: perl(MIME::Base64) BuildRequires: perl(Scalar::Util) BuildRequires: perl(Task::Weaken) BuildRequires: perl(Test::More) BuildRequires: perl(URI) BuildRequires: perl(XML::Parser) >= 2.23 # Optional BuildRequires: perl(LWP::UserAgent) BuildRequires: perl(Crypt::SSLeay) BuildRequires: perl(MIME::Lite) BuildRequires: perl(HTTP::Daemon) BuildRequires: perl(Apache) BuildRequires: perl(FCGI) BuildRequires: perl(MIME::Parser) BuildRequires: perl(Net::POP3) BuildRequires: perl(IO::File) BuildRequires: perl(IO::Socket::SSL) BuildRequires: perl(Compress::Zlib) Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version)) Requires: perl(Compress::Zlib) Requires: perl(Encode) Requires: perl(Errno) Requires: perl(HTTP::Daemon) Requires: perl(HTTP::Headers) Requires: perl(HTTP::Request) Requires: perl(LWP::UserAgent) Requires: perl(MIME::Base64) Requires: perl(MIME::Entity) Requires: perl(MIME::Parser) Requires: perl(POSIX) Requires: perl(URI) Requires: perl(XML::Parser) Requires: perl(XML::Parser::Lite) # RPM 4.8 filters %{?filter_setup: %filter_from_requires /perl(My::/d %filter_from_provides /perl(My::/d %filter_from_provides /perl(LWP::Protocol)/d %?perl_default_filter } # RPM 4.9 filters %global __provides_exclude %{?__provides_exclude:%__provides_exclude|}perl\\(My::.*\\) %global __provides_exclude %__provides_exclude|perl\\(LWP::Protocol\\) %global __requires_exclude %{?_requires_exclude:%__requires_exclude|}perl\\(My::\\) %description SOAP::Lite is a collection of Perl modules which provides a simple and lightweight interface to the Simple Object Access Protocol (SOAP) both on client and server side. %prep %setup -q -n SOAP-Lite-%{version} #%patch0 -p1 -b .IO find examples -type f -exec chmod ugo-x {} \; %build perl Makefile.PL --noprompt INSTALLDIRS=vendor make %{?_smp_mflags} %install make pure_install PERL_INSTALL_ROOT=%{buildroot} find %{buildroot} -type f -name .packlist -exec rm -f {} ';' find %{buildroot} -type d -depth -exec rmdir {} 2>/dev/null ';' chmod -R u+w %{buildroot}/* %check make test %files %doc Changes README ReleaseNotes.txt examples %{_bindir}/*pl %{perl_vendorlib}/SOAP %{perl_vendorlib}/Apache %{perl_vendorlib}/IO %{perl_vendorlib}/UDDI %{perl_vendorlib}/XML %{perl_vendorlib}/XMLRPC %{_mandir}/man3/* %{_mandir}/man1/* %changelog * Thu Aug 02 2012 Petr .abata <contyk@redhat.com> - 0.715-2 - Bundle 0.714 IO modules to fix dependency breakage (confirmed as unintentional by upstream) * Thu Jul 19 2012 Petr .abata <contyk@redhat.com> - 0.715-1 - 0.715 bump - Drop command macros * Fri Jun 29 2012 Petr Pisar <ppisar@redhat.com> - 0.714-3 - Perl 5.16 rebuild * Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.714-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild * Mon Aug 22 2011 Petr Sabata <contyk@redhat.com> - 0.714-1 - 0.714 bump * Wed Aug 17 2011 Petr Sabata <contyk@redhat.com> - 0.713-1 - 0.713 bump - Drop all patches (included upstream) - Remove now obsolete defattr * Fri Jul 22 2011 Petr Sabata <contyk@redhat.com> - 0.712-8 - RPM 4.9 dependency filtering added - Add patch for XML::Parser::Lite from rt#68088; perl5.14 fix * Thu Jul 21 2011 Petr Sabata <contyk@redhat.com> - 0.712-7 - Perl mass rebuild * Wed Jul 20 2011 Petr Sabata <contyk@redhat.com> - 0.712-6 - Perl mass rebuild * Tue May 31 2011 Petr Sabata <contyk@redhat.com> - 0.712-5 - Filter LWP::Protocol from Provides (#709269) * Tue May 17 2011 Petr Sabata <psabata@redhat.com> - 0.712-4 - Do not require Apache2::*; this introduces mod_perl/httpd dependencies This is optional and needed only when running under mod_perl which provides those modules. (#705084) - Use read() instead of sysread() under mod_perl (#663931), mod_perl patch * Fri Apr 8 2011 Petr Sabata <psabata@redhat.com> - 0.712-3 - BuildArch: noarch * Wed Apr 6 2011 Petr Sabata <psabata@redhat.com> - 0.712-2 - Fix Requires typos * Tue Apr 5 2011 Petr Sabata <psabata@redhat.com> - 0.712-1 - 0.712 bump - Removing clean section - Removing 'defined hash' patch (included upstream) - Fixing BRs/Rs; hopefully I didn't omit anything * Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.711-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild * Tue Nov 23 2010 Marcela Ma.lávámmaslano@redhat.com> - 0.711-2 - add R: LWP::UserAgent and clean spec from buildroot * Thu Jun 3 2010 Marcela Ma.lávámmaslano@redhat.com> - 0.711-1 - update and apply fix from https://rt.cpan.org/Public/Bug/Display.html?id=52015 * Thu May 13 2010 Ralf Corséus <corsepiu@fedoraproject.org> - 0.710.10-4 - BR: perl(version) (Fix perl-5.12.0 build breakdown). * Thu May 06 2010 Marcela Maslanova <mmaslano@redhat.com> - 0.710.10-3 - Mass rebuild with perl-5.12.0 * Mon Jan 18 2010 Stepan Kasal <skasal@redhat.com> - 0.710.10-2 - limit BR perl(FCGI) to Fedora * Wed Oct 7 2009 Stepan Kasal <skasal@redhat.com> - 0.710.10-1 - new upstream release - drop upstreamed patch - add missing build requires - use %%filter-* macros * Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.710.08-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild * Fri May 8 2009 Michael Schwendt <mschwendt@fedoraproject.org> - 0.710.08-3 - Filter out perl(LWP::Protocol) Provides, which comes from a file not stored in Perl's search path for modules (#472359). * Thu Feb 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.710.08-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild * Thu Dec 11 2008 Lubomir Rintel <lkundrak@v3.sk> - 0.710.08-1 - New upstream release - Enable tests - Include examples in documentation - Don't grab in dependencies of exotic transports (for the sake of consistency with existing practice of Jabber transport) * Tue Sep 09 2008 Lubomir Rintel <lkundrak@v3.sk> - 0.710.07-2 - Re-add the nil patch * Tue Jun 24 2008 Mike McGrath <mmcgrath@redhat.com> - 0.710.07-1 - Upstream released new version * Mon Mar 3 2008 Tom "spot" Callaway <tcallawa@redhat.com> - 0.68-6 - rebuild for new perl * Thu Oct 18 2007 Mike McGrath <mmcgrath@redhat.com> - 0.68-5 - Fixed build requires * Tue Oct 16 2007 Tom "spot" Callaway <tcallawa@redhat.com> - 0.68-4.1 - correct license tag - add BR: perl(ExtUtils::MakeMaker) * Mon Mar 03 2007 Mike McGrath <mmcgrath@redhat.com> - 0.68-4 - bogus reqs diff * Sat Jan 2 2007 Mike McGrath <imlinux@gmail.com> - 0.68-3 - Changed the way this package removes bogus reqs for EL4 * Sun Sep 10 2006 Mike McGrath <imlinux@gmail.com> - 0.68-1 - Rebuild * Tue Jul 18 2006 Mike McGrath <imlinux@gmail.com> - 0.68-1 - New upstream source - Patch provided for <value><nil/></value> issues * Mon Mar 20 2006 Mike McGrath <imlinux@gmail.com> - 0.67-2 - Removed perl requirements that do not yet exist in Extras * Sat Mar 18 2006 Mike McGrath <imlinux@gmail.com> - 0.67-1 - New Owner and new spec file * Wed Oct 26 2005 Ville Skyttäville.skytta at iki.fi> - 0.60a-3 - Fix build, doc permissions (#169821). * Wed Apr 06 2005 Hunter Matthews <thm@duke.edu> 0.60a-2 - Review suggestions from Joséedro Oliveira * Fri Mar 18 2005 Hunter Matthews <thm@duke.edu> 0.60a-1 - Initial packaging.
Subject: patch-0.715-0.716-2013-01-13-Michael_R._Davis-mrdvt92.diff
Property changes on: . ___________________________________________________________________ Modified: svn:ignore - Makefile.old *.tar.gz .project patches SOAP-Lite-0.* + Makefile.old *.tar.gz .project patches SOAP-Lite-0.* pm_to_blib blib Makefile Index: t/04-attach-cid-encoded.t =================================================================== --- t/04-attach-cid-encoded.t (revision 0) +++ t/04-attach-cid-encoded.t (revision 0) @@ -0,0 +1,219 @@ +#!/bin/env perl + +BEGIN { + unless(grep /blib/, @INC) { + chdir 't' if -d 't'; + unshift @INC, '../lib' if -d '../lib'; + } +} + +use strict; +use Test; + +BEGIN { + use SOAP::Lite; + eval { SOAP::Packager::MIME->new->initialize_parser; 1 }; + if ($@) { + $@ =~ s/ at .+//; + print "1..0 # Skip: $@"; exit; + } +} + +BEGIN { plan tests => 15 } + +my($a, $soap, $d, $s, $r, $serialized, $deserialized); + +{ # check attachment deserialization + $soap = SOAP::Lite->new(); + $soap->init_context(); + + ############################################################################## + print "Attachment deserialization (Content-ID) test(s)...\n"; + $a = $soap->deserializer->deserialize(<<'EOX'); +Content-Type: Multipart/Related; boundary=MIME_boundary; type="text/xml"; start="<claim061400a.xml@claiming-it.com>" +SOAPAction: http://schemas.risky-stuff.com/Auto-Claim +Content-Description: This is the optional message description. + +--MIME_boundary +Content-Type: text/xml; charset=UTF-8 +Content-Transfer-Encoding: 8bit +Content-ID: <claim061400a.xml@claiming-it.com> + +<?xml version='1.0' ?> +<soap:Envelope + xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> + <soap:Body> + <claim:insurance_claim_auto + id="insurance_claim_document_id" + xmlns:claim="http://schemas.risky-stuff.com/Auto-Claim"> + <theSignedForm href="cid:claim061400a.tiff%40claiming-it.com" /> + <theCrashPhoto href="cid:claim061400a.jpeg%40claiming-it.com" /> + <somexml href="cid:claim061400a.somexml%40claiming-it.com" /> + <realxml href="cid:claim061400a.realxml%40claiming-it.com" /> + <!-- ... more claim details go here... --> + </claim:insurance_claim_auto> + </soap:Body> +</soap:Envelope> + +--MIME_boundary +Content-Type: image/tiff +Content-Transfer-Encoding: base64 +Content-ID: <claim061400a.tiff@claiming-it.com> + +AAECAyAgIAQFBg== +--MIME_boundary +Content-Type: image/jpeg +Content-Transfer-Encoding: binary +Content-ID: <claim061400a.jpeg@claiming-it.com> + +...Raw JPEG image.. +--MIME_boundary +Content-Type: text/plain +Content-Transfer-Encoding: binary +Content-ID: <claim061400a.somexml@claiming-it.com> + +<a><b>c</b></a> +--MIME_boundary +Content-Type: text/xml +Content-Transfer-Encoding: binary +Content-ID: <claim061400a.realxml@claiming-it.com> + +<a><b>c</b></a> +--MIME_boundary-- + +EOX + + ok(ref $a); + ok(ref $a && ref $a->valueof('//insurance_claim_auto') && + $a->valueof('//insurance_claim_auto')->{theCrashPhoto} =~ /JPEG/); + ok(ref $a && $a->valueof('//theCrashPhoto') =~ /Raw JPEG image/); + ok(ref $a && $a->valueof('//theSignedForm') eq "\0\1\2\3 \4\5\6"); + ok(ref $a && $a->valueof('//somexml') =~ m!<a><b>c</b></a>!); + ok(ref $a && $a->valueof('//realxml')->{b} eq 'c'); + + ############################################################################## + print "Attachment deserialization (Content-ID and Content-Location) test(s)...\n"; + $a = $soap->deserializer->deserialize(<<'EOX'); +MIME-Version: 1.0 +Content-Type: Multipart/Related; boundary=MIME_boundary; type="text/xml"; start="<http://claiming-it.com/claim061400a.xml>" +Content-Description: This is the optional message description. + +--MIME_boundary +Content-Type: text/xml; charset=UTF-8 +Content-Transfer-Encoding: 8bit +Content-ID: <http://claiming-it.com/claim061400a.xml> +Content-Location: http://claiming-it.com/claim061400a.xml + +<?xml version='1.0' ?> +<soap:Envelope + xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> + <soap:Body> + <claim:insurance_claim_auto + id="insurance_claim_document_id" + xmlns:claim="http://schemas.risky-stuff.com/Auto-Claim"> + <theSignedForm href="http://claiming-it.com/claim061400a.tiff" /> + </claim:insurance_claim_auto> + </soap:Body> +</soap:Envelope> + +--MIME_boundary +Content-Type: image/tiff +Content-Transfer-Encoding: binary +Content-ID: <http://claiming-it.com/claim061400a.tiff> +Content-Location: http://claiming-it.com/claim061400a.tiff + +...binary TIFF image... +--MIME_boundary-- + +EOX + + ok(ref $a); + ok(ref $a && ref $a->valueof('//insurance_claim_auto') && + $a->valueof('//insurance_claim_auto')->{theSignedForm} =~ /TIFF/); + ok(ref $a && $a->valueof('//theSignedForm') =~ /binary TIFF image/); + + ############################################################################## + print "Attachment deserialization (relative Content-Location) test(s)...\n"; + # TODO - this unit test breaks - it does not seem to be picking up a base location + # from outer Content-Location + eval { $a = $soap->deserializer->deserialize(<<'EOX'); }; +MIME-Version: 1.0 +Content-Type: Multipart/Related; boundary=MIME_boundary; type="text/xml"; start="<http://claiming-it.com/claim061400a.xml>" +Content-Description: This is the optional message description. +Content-Location: http://claiming-it.com/ + +--MIME_boundary +Content-Type: text/xml; charset=UTF-8 +Content-Transfer-Encoding: 8bit +Content-ID: <http://claiming-it.com/claim061400a.xml> +Content-Location: claim061400a.xml + +<?xml version='1.0' ?> +<soap:Envelope + xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> + <soap:Body> + <claim:insurance_claim_auto + id="insurance_claim_document_id" + xmlns:claim="http://schemas.risky-stuff.com/Auto-Claim"> + <theSignedForm href="cid:claim061400a.tiff" /> + </claim:insurance_claim_auto> + </soap:Body> +</soap:Envelope> + +--MIME_boundary +Content-Type: image/tiff +Content-Transfer-Encoding: binary +Content-Id: <claim061400a.tiff> +Content-Location: claim061400a.tiff + +...binary TIFF image... +--MIME_boundary-- + +EOX + ok(ref $a); + ok(ref $a && ref $a->valueof('//insurance_claim_auto') && + $a->valueof('//insurance_claim_auto')->{theSignedForm} =~ /TIFF/); + ok(ref $a && $a->valueof('//theSignedForm') =~ /binary TIFF image/); + + ############################################################################## + print "Attachment deserialization (no default Content-Location) test(s)...\n"; + $a = $soap->deserializer->deserialize(<<'EOX'); +MIME-Version: 1.0 +Content-Type: Multipart/Related; boundary=MIME_boundary; type="text/xml"; start="<b6f4ccrt@15.4.9.92/s445>" +Content-Description: This is the optional message description. + +--MIME_boundary +Content-Type: text/xml; charset=UTF-8 +Content-Transfer-Encoding: 8bit +Content-ID: <b6f4ccrt@15.4.9.92/s445> +Content-Location: claim061400a.xml + +<?xml version='1.0' ?> +<soap:Envelope + xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> + <soap:Body> + <claim:insurance_claim_auto + id="insurance_claim_document_id" + xmlns:claim="http://schemas.risky-stuff.com/Auto-Claim"> + <theSignedForm href="cid:a34ccrt%4015.4.9.92/s445" /> + </claim:insurance_claim_auto> + </soap:Body> +</soap:Envelope> + +--MIME_boundary +Content-Type: image/tiff +Content-Transfer-Encoding: binary +Content-ID: <a34ccrt@15.4.9.92/s445> +Content-Location: the_signed_form.tiff + +...binary TIFF image... +--MIME_boundary- + +EOX +# <theSignedForm href="cid:the_signed_form.tiff"/> + + ok(ref $a); + ok(ref $a && ref $a->valueof('//insurance_claim_auto') && + $a->valueof('//insurance_claim_auto')->{theSignedForm} =~ /TIFF/); + ok(ref $a && $a->valueof('//theSignedForm') =~ /binary TIFF image/); +} Index: lib/SOAP/Lite.pm =================================================================== --- lib/SOAP/Lite.pm (revision 418) +++ lib/SOAP/Lite.pm (working copy) @@ -18,7 +18,7 @@ use 5.006; #weak references require perl 5.6 use strict; -our $VERSION = 0.715; +our $VERSION = 0.716; # ====================================================================== package SOAP::XMLSchemaApacheSOAP::Deserializer; @@ -2049,6 +2049,7 @@ use vars qw(@ISA); use SOAP::Lite::Utils; use Class::Inspector; +use URI::Escape qw{uri_unescape}; @ISA = qw(SOAP::Cloneable); @@ -2298,8 +2299,10 @@ } elsif (exists $attrs->{href}) { (my $id = delete $attrs->{href}) =~ s/^(#|cid:|uuid:)?//; + my $type=$1; + $id=uri_unescape($id) if (defined($type) and $type eq 'cid:'); # convert to absolute if not internal '#' or 'cid:' - $id = $self->baselocation($id) unless $1; + $id = $self->baselocation($id) unless $type; return $self->hrefs->{$id} if exists $self->hrefs->{$id}; # First time optimization. we don't traverse IDs unless asked for it. # This is where traversing id's is delayed from before Index: MANIFEST =================================================================== --- MANIFEST (revision 418) +++ MANIFEST (working copy) @@ -149,6 +149,7 @@ t/02-payload.t t/03-server.t t/04-attach.t +t/04-attach-cid-encoded.t t/05-customxml.t t/06-modules.t t/07-xmlrpc_payload.t Index: Changes =================================================================== --- Changes (revision 418) +++ Changes (working copy) @@ -15,6 +15,8 @@ ----------------------------------------------------------------------- THIS RELEASE ----------------------------------------------------------------------- +0.717 + ! #82416: xop href cid: URI encoded support reported by Michael R. Davis (mrdvt92) 0.716 ! #78502 t/08-schema.t noisy under 5.17.2 (unescaped left brace in regex is deprecated) ! #78608 Documentation for "+trace"
Show quoted text
> Attached is patch. The "real" change is only these two lines of code.
I ended up having to back port the change to perl-SOAP-Lite-0.710.10- 1.fc12 RPM. Attached is my patch to be 100% forwards and backwards compatible.
Subject: perl-SOAP-Lite-0.710.10-1_to_-0.710.91-4.patch.zip

Message body not shown because it is not plain text.

Thanks, patch applied in 0.717!