I'm having a difficult time understanding why using DBI is causing a SOAP module to not work. When I use DBI in a module and restart the SOAP server, function calls return nothing but undef results (I'm assuming what's happening is the soap server couldn't dispatch the module). When I comment out the use DBI and all my DBI code in my module and restart the server it works fine. Here's a stripped down example that shows the problem.
Client:
#!/usr/bin/perl
use strict;
use warnings;
use SOAP::Lite;
my $soap = SOAP::Lite->uri('http://localhost/Test')->proxy('http://loc
+alhost:8089/');
print 'Returned: ', $soap->return1()->result(), "\n";
Soap Server:
#!/usr/bin/perl
use strict;
use warnings;
use SOAP::Transport::HTTP;
SOAP::Transport::HTTP::Daemon
-> new (LocalPort => 8089, Reuse => 1)
-> dispatch_to('/opt/scripts/SOAP/lib')
-> handle;
Module:
package Test;
use DBI;
sub return1 { return 1; }
1;
This code works fine when "use DBI;" is commented, returning 1. When uncommented it returns undef.
Any thoughts? I've googled around for SOAP::Transport and DBI issues and have seen some folks with not-so-similar problems but nothing matching my own. I'm new to using SOAP but have successfully implemented scripts that don't use DBI.
EDIT: I should also add that DBI works fine on this box in a non-soap environment. This script works fine with use DBI commented or not in the module.
#!/usr/bin/perl
use strict;
use warnings;
use lib '/opt/scripts/SOAP/lib';
use Test;
print Test::return1(), "\n";
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.