Perl Script: Internal Server Error

I've developed a code where I'm sending an XML document via SOAP to a server but I'm getting an Internal server Error, I can't work out the problem. I'll list my code, can someone please point out to me where I'm going wrong.


#!perl -w
#!c:\indigoperl\bin\perl.exe

use lib 'c:\indigoperl';
#use SOAP::Lite;

#---------------------------------------------------------------------------------
#use this line of code underneath ->proxy and before the ; to get an output of the
#XML request and response pair.  Excellent for debugging
#
#           ->on_debug(sub{print@_})
#----------------------------------------------------------------------------------

#declare variables for use throughout the script
#$seekUserName = 'careers';
#$seekPassword = 'recruit';
#$seekRole = 'Client';
$seekxml = '<?xml version="1.0" encoding="UTF-8"?><FastLanePlus UploaderId="19997922" AgentID=""><Client ID="1732" MinJobs="0" MaxJobs="9999999"><Job Reference="CAR1059" TemplateID="85" ScreenID=""><Title>"GAMES DESIGNER"</Title><SearchTitle>GAMES DESIGNER</SearchTitle><Description>WHAT ON EARTH GOES IN DESCRIPTION</Description><AdDetails><![CDATA[<P>Our Client is a world leader in gaming technology. They are seeking to employ a Games Designer for the creation of poker machine concepts, and mathematical calculations, using probability theory. To be considered for this position, you should have:</P><P>Strong creative flair;</P><P>Tertiary qualifications with Math studies;</P><P>C programming;</P><P>Previous experience in the gaming industry is desirable.</P><br><B>To Apply for this job </B>]]></AdDetails><ApplicationEmail>rodgerp@dbasplus.com</ApplicationEmail><ApplicationURL>http://buzzwig.com</ApplicationURL><ResidentsOnly>Yes</ResidentsOnly><Items><Item Name="Bullet1">Leader in Gaming Technology</Item><Item Name="Bullet2">Games Designer with Creative Flair</Item><Item Name="Bullet3">Strong Math ability</Item><Item Name="Consultant">Richard Face</Item><Item Name="ConsultantTelephone">87410456</Item><Item Name="ResumeRequired">No</Item></Items><Listing MarketSegments="Main"><Classification Name="Location">Sydney</Classification><Classification Name="Industry">Accounting</Classification><Classification Name="Discipline">Acctg-Commerce</Classification><Classification Name="WorkType">Full Time</Classification><Classification Name="Function">General Management</Classification></Listing></Job></Client> </FastLanePlus>';

$seekUserName = 'Buzzwig2';
$seekPassword = 'test';
$seekRole = 'Client';
$testAuthProxy = 'http://test.webservices.seek.com.au/FastLanePlus.asmx';
$liveAuthProxy = 'http://webservices.seek.com.au/WebServiceAuthenticator.asmx';

$uri = 'http://webservices.seek.com.au';

#create an object that is a connection to the seek web service
#change the variable $liveProxy
my $s = SOAP::Lite
  ->uri($uri)
  ->proxy($liveAuthProxy)
  ->on_debug(sub{print@_})
  ->on_action(sub{sprintf '%s/%s', @_ })
  ;
print "PRIOR TO GETTING TOKEN\n";
#now we invoke the RpcAuthenticateWS method and store the result in $authToken
#set up the relevant username and password into SOAP data
$userName = SOAP::Data->name('userName')->value($seekUserName);
$password = SOAP::Data->name('password')->value($seekPassword);
$role = SOAP::Data->name('role')->value($seekRole);

#then call the RpcAuthenticateWS method and get the result
$authToken = $s
   ->RpcAuthenticateWS($userName, $password, $role)
   ->result
   ;

print "\nTOKEN RETURNED  $authToken\n";

#now we have the authorisation token, we call RpcUploadFile to upload the xml document
$liveUploadProxy = 'http://webservices.seek.com.au/FastLanePlus.asmx';

$testUploadProxy = 'http://test.webservices.seek.com.au/FastLanePlus.asmx';

#create object that is a connection to the soap server
my $uploader = SOAP::Lite
  ->uri($uri)
  ->proxy($liveUploadProxy)
  ->on_debug(sub{print@_})
  ->on_action(sub{sprintf '%s/%s', @_ })
  ;
print "\nPRIOR TO UPLOAD\n";
print "\n XML STRING BEING UPLOADED IS $seekxml \n\n";
#now we invoke the RpcUploadFile method.
#first set up the parameters passed to the function
$token = SOAP::Data->name('Token')->value($authToken);
#####$data = SOAP::Data->name("axmlFastlaneFile")->value($seekxml);
$data = SOAP::Data->name("xmlFastlaneFile")->value($seekxml);

#and then call the function
$uploadResult = $uploader
  ->RpcUploadFile($token, $data)
  ;
print "\nAFTER UPLOAD\n";
LVL 1
maykutAsked:
Who is Participating?
 
TintinConnect With a Mentor Commented:
As ozo says, uncomment the

use SOAP::Lite;

command.

BTW, you shouldn't need the line:

use lib 'c:\indigoperl';

as that will be in the default search path.

Also, checking the Apache webserver error logs will give you the error, or you can add

use CGI::Carp qw(fatalsToBrowser);

to your script to see the errors in the browser.
0
 
ozoCommented:
Did you mean to comment out
#use SOAP::Lite;
0
 
PaulS_IIICommented:
I have had this problem as well with other types of scripts.

I am sure you have already checked this, but I think it is worth restating.

Did you ensure that your script is executable and owned by your web server user?

Also, how are you executing the script? You might want to check either the web server error log or maybe the messages log (assuming this is being run from a linux box, maybe a wrong assumption) for some clues.

I could be way wrong, so if I am, my apologies.
0
 
maykutAuthor Commented:
guys I think its working I'm just doing some more testing on it.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.