[Xml-compile] [SOLVED] wsdl->call() fails over https transport with "certificate verify failed"

Darija Tadin-Đurović 68darki at gmail.com
Thu Feb 26 16:02:01 GMT 2015


* Mark Overmeer <solutions at overmeer.net> [2015-02-26 14:28:02 +0100]:

>See XML::Compile::SOAP::FAQ "Adding HTTP header" for an example which
>includes ssl options.
>-- 
>Regards,
>               MarkOv

Hi,
got it precisely now. SOLVED. Thanks for pointing me.

Analysis follows:
1. Goal:
    Make a wsdl->call() over https, using a certain SSL_ca_file
2. Assumptions:
    - $ua is an LWP::UserAgent
    - $ua's ssl_options are set accordingly
    - $wsdl is an XML::Compile::WSDL11, or, by inheritance, something 
      adequate
3. This is what MATTERS:
    3.1 create an XML::Compile::Transport::SOAPHTTP object (a 
      $transport), including the abovementioned $ua in %options:
      my $transport = XML::Compile::Transport::SOAPHTTP->new
	( ... , user_agent => $ua , ... )
    3.2 somehow include this $transport among other options when calling 
      $wsdl->compileCall( ... ):
      3.2.a  either directly
	    ( ... , transport => $transport , ...)
      3.2.b  or indirectly:
	    my $send = $transport->compileClient();
	    $wsdl->compileCall ( ... , transport => $send , ...)
4. This is what _does not matter_:
    Including or not either transport => $send or transport => $transport 
    when calling $call = $wsdl->compileClient ( ... );


The diff (with an intentionally fat context) gives:

*** justEcho.NOK	2015-02-26 15:55:38.364160455 +0100
--- justEcho		2015-02-26 15:57:56.360154653 +0100
***************
*** 62,74 ****
   my $send = $transport->compileClient();  # $ua figures in $transport !
   my $call = $wsdl->compileClient ( operation => 'echo'
   #  , transport => $send  # this line has no visible effect!!
      );
   my $operation = $wsdl->operation(operation => 'echo');
   $wsdl->compileCall( $operation
   ); 
   warn Dumper $wsdl;
   my ($out, $trace) = $wsdl->call('echo', _ => 'Hi there!');
   print '------------- $wsdl>call( ... ------ REQ --', "\n";
   $trace->printRequest(pretty_print => 1);
   print '------------- $wsdl>call( ... ------ ERR --', "\n";
   $trace->printErrors;
--- 62,75 ----
   my $send = $transport->compileClient();  # $ua figures in $transport !
   my $call = $wsdl->compileClient ( operation => 'echo'
   #  , transport => $send  # this line has no visible effect!!
      );
   my $operation = $wsdl->operation(operation => 'echo');
   $wsdl->compileCall( $operation
+ 	, transport => $send  # this really includes $ua 's ssl_opts !!!
   );
   warn Dumper $wsdl;
   my ($out, $trace) = $wsdl->call('echo', _ => 'Hi there!');
   print '------------- $wsdl>call( ... ------ REQ --', "\n";
   $trace->printRequest(pretty_print => 1);
   print '------------- $wsdl>call( ... ------ ERR --', "\n";
   $trace->printErrors;

Thank you, MarkOv :-)

Cheers!
Darki

-- 
If you want something very, very badly, let it go free.  If it comes 
back to you, it’s yours forever.  If it doesn’t, it was never yours to 
begin with.
	- Jess Lair, "I Ain’t Much Baby - But I’m All I’ve Got"





More information about the Xml-compile mailing list