---
title: "SOAP::Lite - Insecure dependency in eval while running with -T"
author: "ShellyLi"
date: "2012-02-22T17:26:23Z"
tags: []
categories: ["编程语言"]
slug: "soap-lite-insecure-dependency-in-eval-while-running-with-t"
draft: false
lastmod: "2012-02-22T17:26:52Z"
id: 1418274
url: "https://shellyli.iteye.com/blog/1418274"
---

Hi PerlMonks, 
I'm using SOAP::Lite to do some online payments. The whole mechanism is set on separate machine which is communicating with payment gateway. So WWW machine sends a message to invoke SOAP::Lite and SOAP message is sent to payment gateway.

In development I had both "machines" running on one (separate instances) and there was no problem, but the moment it went on two separate machines I got this error from SOAP::Lite :

Code execution error: Method  returned error: Insecure dependency in eval while running with -T switch at /usr/lib/perl5/site_perl/5.8.8/SOAP/Lite.pm line 3225 
Any idea?

Milos

----------------------------------------------------------------------Hi, I tried the trick (added in new line 3363):

sub generate_stub {
...

    $self->{'_stub'} = $1 if $self->{'_stub'} =~ /^(.*)/;
    return $self->stub;
}
and the error has changes . Now it's:

Code execution error: Method  returned error: Bad stub:  at /usr/lib/perl5/site_perl/5.8.8/SOAP/Lite.pm line 3669 
which with moving one line bellow (adding the fix line) is:

my %services = %{$self->schema->parse(@_)->load->services}; 
So the fix won't do.

As for the code example, I'll try to make something later during the day, but it's not so easy because I have XMLRPC web service calling SOAP service. And like I said, when it's on the same machine (but running on two different instances) everything's fine. When I put this SOAP to other machine I get this.

----------------------------------------------------------------------

I "solved" the problem just by adding

my $result = $1 if ($self->generate_stub($_) =~ m{^(.+)}s); 
before

eval $result or Carp::croak "Bad stub: $@"; 
which was previously

eval $self->generate_stub($_) or Carp::croak "Bad stub: $@"; 
and it works now. Not really elegant, but I need this urgently so it should do. Alfter that I'm getting this warning message:

could not find ParserDetails.ini in /usr/lib/perl5/site_perl/5.8.8/XML/SAX

Is this related?


http://www.perlmonks.org/?node_id=895450