Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

Hi all,

I'm hoping one of you kind souls can point out where, exactly, I'm being a bit dim, as the problem I have, well it just has to be something really simple, but I just can't see it...

I have a SOAP server:

#!/usr/local/bin/perl use strict; use warnings; use SOAP::Transport::HTTP; $|++; my $daemon = SOAP::Transport::HTTP::Daemon -> new( LocalAddr => 'localhost', LocalPort => 8080, R +euse => 1 ) -> dispatch_to('/Users/johno/Code/DCI/Wordbank-DCI-Ser +ver/lib'); print STDERR "SOAP server startup at ", $daemon->url, "\nServer INC:", + join(' ', @INC), "\n"; $daemon->handle;

...which is called from the following client:

#!/usr/local/bin/perl use strict; use warnings; #use SOAP::Lite +trace => ['all', '-transport']; use SOAP::Lite; my $soap = SOAP::Lite->new( uri => 'http://DCI/Wordbank::DCI::Server', proxy => '', on_fault => sub { my($soap, $res) = @_; die ref $res ? $res->faultdetail : $soap->tran +sport->status, "\n"; }); print $soap->hello()->result, "\n";

...and the server calls the following module:

package Wordbank::DCI::Server; use vars qw(@ISA); @ISA = qw(SOAP::Server::Parameters); use strict; use warnings; use Carp; sub hello { my $self = shift; print STDERR 'Module INC: ', join(' ', @INC), "\n"; return "Hello, world\n"; } 1;

All of which works perfectly, calls the hello method, and prints out quite a reasonable @INC value. Until I add in use Data::Dumper immediately after the use Carp line in the module, at which point I get the following (excerpted) error when I turn tracing on:

<soap:Fault><faultcode>soap:Client</faultcode><faultstring>Failed to a +ccess class (Wordbank::DCI::Server): Can't locate Data/ in @ +INC (@INC contains: /Users/johno/Code/DCI/Wordbank-DCI-Server/lib) at + /Users/johno/Code/DCI/Wordbank-DCI-Server/lib/Wordbank/DCI/ + line 9. BEGIN failed--compilation aborted at /Users/johno/Code/DCI/Wordbank-DC +I-Server/lib/Wordbank/DCI/ line 9. Compilation failed in require at (eval 98) line 3. </faultstring><faultactor>http://localhost:8080/</faultactor></soap:Fa +ult>

...i.e. it appears that @INC is getting zapped to only contain the current module's directory. I can't even use lib... something to get around it as it can't use 'lib'.

Can anyone reproduce this? Am I being a complete klutz? Hay-ulp...

(OSX 10.4.8, Perl 5.8.8, SOAP::Lite 0.69)


Thanks to both almut and Ultra for both speedy and accurate replies.

In reply to @INC problem with SOAP::Lite by john_oshea

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or or How to display code and escape characters are good places to start.
Log In?

What's my password?
Create A New User
Domain Nodelet?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (1)
As of 2021-10-17 13:35 GMT
Find Nodes?
    Voting Booth?
    My first memorable Perl project was:

    Results (71 votes). Check out past polls.