Skip Menu |

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

Report information
The Basics
Id: 101383
Status: resolved
Priority: 0/
Queue: XML-Compile-SOAP

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

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: [patch] Use of uninitialized value $ns in string eq at XML::Compile::Cache
Hello! First of all, let me just say a big **THANK YOU** for all the XML::Compile suite. It has consistently solved a lot of problems and saved me a lot of time over the years! The reason for this ticket is that, while I was using it to implement a SOAP interface to the Brazilian postal service, I found myself triggering "uninitialized" warnings all over the place. I fixed it by changing line 87 of XML/Compile/SOAP11/Operation.pm like so: -----------8<----------- - my $rpc_ns = $body->{namespace}; + my $rpc_ns = (defined $body->{namespace} ? $body->{namespace} : ''); ----------->8----------- If you feel I fixed the wrong part of the code or broke something else (which is entirely possible, though all the current test suite still passes with this patch), or if I just plain screwed up and forgot to set X or Y properly, the code below reproduces the warnings I'm seeing and might help diagnose the issue better: -----------8<----------- use strict; use warnings; use XML::Compile::WSDL11; use XML::Compile::SOAP11; use XML::Compile::Transport::SOAPHTTP; use HTTP::Tiny; my $wsdl = XML::Compile::WSDL11->new( HTTP::Tiny->new->get('https://apphom.correios.com.br/SigepMasterJPA/AtendeClienteService/AtendeCliente?wsdl')->{content} ); my $call = $wsdl->compileClient('buscaCliente'); ----------->8----------- This is what I see when I run it: $ perl xml_compile.pl Use of uninitialized value $ns in hash element at /Users/garu/.plenv/versions/5.20.1/lib/perl5/site_perl/5.20.1/XML/Compile/Cache.pm line 125. Use of uninitialized value $ns in hash element at /Users/garu/.plenv/versions/5.20.1/lib/perl5/site_perl/5.20.1/XML/Compile/Cache.pm line 134. Use of uninitialized value $ns in concatenation (.) or string at /Users/garu/.plenv/versions/5.20.1/lib/perl5/site_perl/5.20.1/XML/Compile/Cache.pm line 135. Use of uninitialized value in string eq at /Users/garu/.plenv/versions/5.20.1/lib/perl5/site_perl/5.20.1/XML/Compile/Cache.pm line 166. Use of uninitialized value $ns in string eq at /Users/garu/.plenv/versions/5.20.1/lib/perl5/site_perl/5.20.1/XML/Compile/Cache.pm line 166. Thank you very much for you time, and for the entire XML::Compile suite! Cheers, garu
Subject: Re: [rt.cpan.org #101383] [patch] Use of uninitialized value $ns in string eq at XML::Compile::Cache
Date: Wed, 7 Jan 2015 22:19:05 +0100
To: "Breno G. de Oliveira via RT" <bug-XML-Compile-SOAP [...] rt.cpan.org>
From: Mark Overmeer <mark [...] overmeer.net>
* Breno G. de Oliveira via RT (bug-XML-Compile-SOAP@rt.cpan.org) [150107 19:11]: Show quoted text
> Wed Jan 07 14:11:04 2015: Request 101383 was acted upon. > Transaction: Ticket created by GARU > Queue: XML-Compile-SOAP > Subject: [patch] Use of uninitialized value $ns in string eq at
Show quoted text
> The reason for this ticket is that, while I was using it to implement a > SOAP interface to the Brazilian postal service, I found myself triggering > "uninitialized" warnings all over the place.
I released rpc-encoded style SOAP last week... you're "lucky" to find the first problem. Show quoted text
> I fixed it by changing line 87 of XML/Compile/SOAP11/Operation.pm like so: > -----------8<----------- > - my $rpc_ns = $body->{namespace}; > + my $rpc_ns = (defined $body->{namespace} ? $body->{namespace} : ''); > ----------->8-----------
It looks the right fix for the problem... however, as far as I know, the namespace is required. I'll look that up. -- thanks MarkOv ------------------------------------------------------------------------ Mark Overmeer MSc MARKOV Solutions Mark@Overmeer.net solutions@overmeer.net http://Mark.Overmeer.net http://solutions.overmeer.net
Subject: Re: [rt.cpan.org #101383] [patch] Use of uninitialized value $ns in string eq at XML::Compile::Cache
Date: Thu, 8 Jan 2015 10:28:37 +0100
To: "Breno G. de Oliveira via RT" <bug-XML-Compile-SOAP [...] rt.cpan.org>
From: Mark Overmeer <solutions [...] overmeer.net>
* Breno G. de Oliveira via RT (bug-XML-Compile-SOAP@rt.cpan.org) [150107 19:11]: Show quoted text
> Wed Jan 07 14:11:04 2015: Request 101383 was acted upon. > Transaction: Ticket created by GARU > Queue: XML-Compile-SOAP > Subject: [patch] Use of uninitialized value $ns in string > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=101383 >
RPC encoded is ugly. Anyway... probably the parameter is required, but not always implemented that way. Let's just support the real world. Accepted for release 3.07 Show quoted text
> I fixed it by changing line 87 of XML/Compile/SOAP11/Operation.pm like so: > - my $rpc_ns = $body->{namespace}; > + my $rpc_ns = (defined $body->{namespace} ? $body->{namespace} : '');
+ my $rpc_ns = $body->{namespace} // ''; Show quoted text
> my $wsdl = XML::Compile::WSDL11->new( > HTTP::Tiny->new->get('https://apphom.correios.com.br/SigepMasterJPA/AtendeClienteService/AtendeCliente?wsdl')->{content} > );
You have read my disgust about dynamicly loading WSDLs/XSDs in ::Schema chapter DETAILS? There is a new module XML::CompileX::Schema::Loader http://search.cpan.org/~mjgardner/XML-CompileX-Schema-Loader/ which cleanly abstracts away problems with dynamic loading (like additional imports) -- Regards, MarkOv ------------------------------------------------------------------------ Mark Overmeer MSc MARKOV Solutions Mark@Overmeer.net solutions@overmeer.net http://Mark.Overmeer.net http://solutions.overmeer.net
On Thu Jan 08 04:28:50 2015, solutions@overmeer.net wrote: Show quoted text
> * Breno G. de Oliveira via RT (bug-XML-Compile-SOAP@rt.cpan.org) > [150107 19:11]:
> > Wed Jan 07 14:11:04 2015: Request 101383 was acted upon. > > Transaction: Ticket created by GARU > > Queue: XML-Compile-SOAP > > Subject: [patch] Use of uninitialized value $ns in string > > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=101383 >
> > RPC encoded is ugly. Anyway... probably the parameter is required, > but > not always implemented that way. Let's just support the real world. > Accepted for release 3.07
Awesome! Looking forward to that release - thank you! Show quoted text
>
> > I fixed it by changing line 87 of XML/Compile/SOAP11/Operation.pm > > like so: > > - my $rpc_ns = $body->{namespace}; > > + my $rpc_ns = (defined $body->{namespace} ? $body->{namespace} : > > '');
> > + my $rpc_ns = $body->{namespace} // ''; >
> > my $wsdl = XML::Compile::WSDL11->new( > > HTTP::Tiny->new- > > );
> > You have read my disgust about dynamicly loading WSDLs/XSDs in > ::Schema > chapter DETAILS? > > There is a new module XML::CompileX::Schema::Loader > http://search.cpan.org/~mjgardner/XML-CompileX-Schema-Loader/ > which cleanly abstracts away problems with dynamic loading (like > additional imports)
Yup :) The dynamic loading was just so I wouldn't have to attach the full wsdl to the ticket while still allowing you to fetch it for extra debugging; and also to let you know it's something I downloaded from the service provider and don't really have a say in it - i.e. if it's a buggy wsdl I can't really fix it :/ For the actual module (shipping to CPAN as soon as your 3.07 is released) I have downloaded it and this bit in my code looks more like: my $wsdl = XML::Compile::WSDL11->new( 'atende_cliente.wsdl' ); This is the proper way to do it, right? Thanks again! I really appreciate it!
Subject: Re: [rt.cpan.org #101383] [patch] Use of uninitialized value $ns in string eq at XML::Compile::Cache
Date: Thu, 8 Jan 2015 14:42:09 +0100
To: "Breno G. de Oliveira via RT" <bug-XML-Compile-SOAP [...] rt.cpan.org>
From: Mark Overmeer <solutions [...] overmeer.net>
* Breno G. de Oliveira via RT (bug-XML-Compile-SOAP@rt.cpan.org) [150108 13:39]: Show quoted text
> my $wsdl = XML::Compile::WSDL11->new( 'atende_cliente.wsdl' ); > This is the proper way to do it, right?
Yas, that's the way :-) -- Regards, MarkOv ------------------------------------------------------------------------ Mark Overmeer MSc MARKOV Solutions Mark@Overmeer.net solutions@overmeer.net http://Mark.Overmeer.net http://solutions.overmeer.net