Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I got the following error on my work PC, but the same code does not give any error at home, so I must have installed something there before, but I cannot remember... pls help. Thanks.

500 Can't locate object method "new" via package "LWP::Protocol::https +::Socket" at d.pl line 14

Here is the code, simple:

use strict; use warnings; #use SampleService qw=>(:all); #use SOAP::Lite +trace => qw(all); use SOAP::Lite; #$ENV{HTTPS_DEBUG} = '1'; #$ENV{HTTPS_CA_FILE} = 'C:/src/perl/a.cer'; #$ENV{HTTPS_CA_DIR} = 'C:/src/perl'; my $lite = new SOAP::Lite( #uri => 'http://org.jboss.ws/samples/docstyle/bare', proxy => 'https://me:password@aseriesws.somecompany.com:8443/app/servi +ces/module?wsdl'); while (1) { my $start = time(); print"Result = " . $lite->ping()->result . ","; my $end = time(); my $diff = $end - $start; print " started at " . localtime() . ", took " . $diff . " seconds +\n"; sleep(10); }

Replies are listed 'Best First'.
Re: missing package for web service via https?
by idsfa (Vicar) on Nov 03, 2006 at 16:40 UTC

    At a guess, you're missing LWP, which contains that package (LWP::Protocol::https::Socket). Install the bundle with:

    perl -MCPAN -e 'install Bundle::LWP'

    The intelligent reader will judge for himself. Without examining the facts fully and fairly, there is no way of knowing whether vox populi is really vox dei, or merely vox asinorum. — Cyrus H. Gordon