Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > perhaps you forgot to load "URI"?

Reply
Thread Tools

perhaps you forgot to load "URI"?

 
 
Jorge Reyes
Guest
Posts: n/a
 
      08-24-2007
hi, so now this is weird, first of all i want to say that this script
runs ok in windows xp, linux ubuntu 7.04 and the problem is when i put
this into a unix machine this is the code:

use SOAP::Lite qw (debug trace);

$log_folder = "logwsremedyclient";
$fechaActual = &fechaHoraFormatoDb(time);
$log_name = substr($fechaActual,0,10);
$log_name =~ tr/-//d;
$log_name = $log_name.".log";
#print $log_folder.$log_name."\n";

if (! -d $log_folder ) {
#no existe
mkdir($log_folder) || die "ERROR AL INTENTAR CREAR EL
DIRECTORIO: $log_folder";
}

$numArgs = $#ARGV + 1;
if($numArgs < 6) {
$header = "INICIO.- $fechaActual\n";
$content = "ERROR: SE RECIBIERON $numArgs COMMAND-LINE
ARGUMENTS, IMPOSIBLE CONTINUAR SE NECESITAN 6\n";
$footer = "FINAL.- $fechaActual\n\n";
open(WSLOG,">> $log_folder/$log_name") || die "ERROR AL
INTENTAR ABRIR EL LOG: $log_folder/$log_name";
print WSLOG $header.$content.$footer;
close(WSLOG);
exit(1);
}

my $estado = $ARGV[0];
my $remedyid = $ARGV[1];
my $usumod = $ARGV[2];
my $historial = $ARGV[3];
my $telcontacto = $ARGV[4];
my $usua_afec = $ARGV[5];

#my $estado = 'CERRADO';
#my $remedyid = 263;
#my $usumod = 'JORGE REYES';
#my $historial = 'PRUEBA 2 DESDE PERL HACIA WS EN JAVA';
#my $telcontacto = '5530304857';
#my $usua_afec = 8;

my $soap = SOAP::Lite
-> uri('http://serviciosweb.remedyweb.iusacell.com')
-> proxy('http://10.199.11.69:9080/remedyWeb/services/
ActualizaStatus')
-> on_action( sub { join '', @_} );
my $s = $soap->paramRemedy(
SOAP:ata->name('estado')->type(string => $estado),
SOAP:ata->name('remedyid')->type(long => $remedyid),
SOAP:ata->name('usumod')->type(string => $usumod),
SOAP:ata->name('historial')->type(string => $historial),
SOAP:ata->name('telcontacto')->type(string => $telcontacto),
SOAP:ata->name('usua_afec')->type(int => $usua_afec));
unless ($s->fault) {
#print $s->result();
$header = "INICIO.- $fechaActual\n";
$content = "estado: $ARGV[0]\nremedyid: $ARGV[1]\nusumod:
$ARGV[2]\nhistorial: $ARGV[3]\ntelcontacto: $ARGV[4]\nusua_afec:
$ARGV[5]\nRESPUESTA: ".$s->result()."\n";
$footer = "FINAL.- $fechaActual\n\n";
open(WSLOG,">> $log_folder/$log_name") || die "ERROR AL
INTENTAR ABRIR EL LOG: $log_folder/$log_name";
print WSLOG $header.$content.$footer;
close(WSLOG);

}
else {
#print "\n\nError\n";
#print join ', ',
#$s->faultcode,
#$s->faultstring,
#$s->faultdetail,"\n\n";
$header = "INICIO.- $fechaActual\n";
$content = "ERROR: ".join ', ',$s->faultcode, $s->faultstring,
$s->faultdetail, "\n";
$footer = "FINAL.- $fechaActual\n\n";
open(WSLOG,">> $log_folder/$log_name") || die "ERROR AL
INTENTAR ABRIR EL LOG: $log_folder/$log_name";
print WSLOG $header.$content.$footer;
close(WSLOG);
}


sub fechaHoraFormatoDb {
# $_[0] = Unix time, or POSIX time
# NOTA: Al llamar a esta subrutina no poner comillas el
parametro de $_[0]
# Ej: &fechaHoraFormatoDb(time) o &fechaHoraFormatoDb($valor)
my ($segundo,$minuto,$hora,$dia,$mes,$anio,$diaSemana ) =
(localtime($_[0]))[0,1,2,3,4,5,6];
my @mesesNum =
('01','02','03','04','05','06','07','08','09','10' ,'11','12');
my $tiempo = sprintf("%02d:%02d:%02d",$hora,$minuto,$segundo);
$anio = $anio + 1900;
if($dia < 10) {
$dia="0$dia";
}
$tiempoObtenido="$anio-$mesesNum[$mes]-$dia $tiempo";
return $tiempoObtenido;
}

and then when i executed it the answer is:

SOAP::Lite: ()
SOAP::Serializer::envelope: ()
Can't locate object method "new" via package "URI" (perhaps you forgot
to load "URI"?) at /usr/perl5/5.6.1/lib/HTTP/Request.pm line 82.

so any idea suggestions or something useful, sorry but i am desperate
jeje... thanks for advanced

 
Reply With Quote
 
 
 
 
xhoster@gmail.com
Guest
Posts: n/a
 
      08-25-2007
"John" <> wrote:
> >
> > and then when i executed it the answer is:
> >
> > SOAP::Lite: ()
> > SOAP::Serializer::envelope: ()
> > Can't locate object method "new" via package "URI" (perhaps you forgot
> > to load "URI"?) at /usr/perl5/5.6.1/lib/HTTP/Request.pm line 82.
> >
> > so any idea suggestions or something useful, sorry but i am desperate
> > jeje... thanks for advanced
> >

>
> Hi
>
> I had a similar problem when we moved to a new server.
>
> Can't locate object method "new" via package "SOAP:ackager::MIME"
> (perhaps you forgot to load "SOAP:ackager::MIME"?) at
> /usr/lib/perl5/site_perl/5.8.6/SOAP/Lite.pm line 3241.
>
> At first, we thought that the package MIME was missing but once we
> re-installed
> SOAP Lite (force installation) it was OK.


This is because there are two SOAP:ackager modules, one part of
SOAP and one part of SOAP::Lite. SOAP::Lite's defines MIME internally,
and SOAP's doesn't. So if SOAP::Lite loads SOAP's version, it fails. When
you reinstalled, either SOAP::Lite's module overwrite SOAP's, or it was
installed into a place that came earlier in @INC.


http://search.cpan.org/src/KBROWN/SO...AP/Packager.pm
http://search.cpan.org/src/BYRNE/SOA...AP/Packager.pm


> It might be that package URI is missing, but, my guess a fresh
> installation odf SOAP::Lite will fix it.


I bet the OP's problem is similar. Instead of loading a SOAP::Lite module
which has a "use URI" in it, it loads a same-named SOAP module which
doesn't have "use URI" in it.

Xho

--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service $9.95/Month 30GB
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: OT: Happy Birthday [You forgot, you !@#*(] Pedro Simoes MCSE 0 11-24-2005 07:52 PM
OT: Happy Birthday [You forgot, you !@#*(] Pedro Simoes MCSE 0 11-24-2005 07:52 PM
OT: Happy Birthday [You forgot, you !@#*(] Microcephalic S. Bob MCSE 2 11-15-2005 02:18 PM
Can't locate object method "first" via package "attempt" (perhaps you forgot to load "attempt"?) at .... GMI Perl Misc 3 06-19-2005 10:44 PM
....how can you tell he is an aussie? Perhaps he is North Kangarean? (go the eddies) rmcc70 Computer Support 0 09-03-2003 12:02 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57