I have a perl script that implements a web service using Frontier::RPC2 and Frontier::Responder . I have written a test script that invokes the various methods and get results. 32 of the tests succeed. However, I am finding that I am receiving the following when I invoke what seems to be 2 pretty simple methods (this message, of course, is only from one of the two tests - the other test generates a quite similar error):
Uncaught exception from user code:
500 Too many header lines (limit is 128)
Frontier::Client::call('Frontier::Client=HASH(0x13b608)', 'Get
+AllByDept', 27) called at Misc/testuiv2.pl line 119
The line 119 in the test script is:
$aresults = $server->call('GetAllByDept', $dept_no);
where $dept_no is 27. The method is pretty simple and works like the other methods already tested. When I run the sql statement used in the method directly against the database, it works without a problem.
Here's the code in the method.
sub GetAllByDept{
my (@next_row);
my @retval; #this will be array of arrays
my $rc;
my($SearchDept) = @_ or do {
ERROR( "GetAllByDept: no argument provided" );
return \@retval;
};
INFO( "GetAllByDept: $SearchDept passed" );
if ($SearchDept !~ /^\d+$/) {
ERROR( "GetAllByDept: argument provided not a number" );
return \@retval;
}
#query db to find information
my $dbconn = DBI->connect("DBI:Oracle:$DBHOST",$DBUSER,$DBPASS) or d
+o {
ERROR( "GetAllByDept: ORACLE connect failed - $DBI::errstr" );
+
return \@retval;
};
my $query = $dbconn->prepare(
"Select * from $Schema.CSI_HR_V2 where DEPT_NO = ?") o
+r do {
ERROR( "GetAllByDept: ORACLE prepare failed - $DBI::errstr" );
$dbconn->disconnect();
return \@retval;
};
DEBUG( "GetAllByDept: query = $query" );
$rc = $query->execute($SearchDept) or do {
ERROR( "GetAllByDept: ORACLE execute failed for $SearchDept -
+$DBI::errs
tr" );
$query->finish;
$dbconn->disconnect();
return \@retval; #problem return empty array
};
my $count = 0;
@next_row= $query->fetchrow_array();
while (@next_row) #get rows and add to return array of hashes
{
#get staff information
$count++;
push(@retval,{Alt_Emp_No => $next_row[0], Job_Class => $next_row[1
+],
Title => $next_row[2],Dept_Code => $next_row[3],
Dept_No => $next_row[4],
Last_Name => $next_row[5],First_Name => $next_row[6],
Middle_Name => $next_row[7],
Supervisor_Emp_No => $next_row[8], Status => $next_row
+[9],
Suffix_Name => $next_row[10], Extension => $next_row
+[11],
Room_No => $next_row[12], Email => $next_row[13],
Login => $next_row[14], Login_History => $next_row[1
+5],
Contractor => $next_row[16],
Create_Date => $next_row[17], Mod_Date => $next_row[18
+]
});
@next_row= $query->fetchrow_array();
}
INFO( "GetAllByDept: $count records found for $SearchDept");
$query->finish;
$dbconn->disconnect();
return \@retval;
}
The web service methods all are using DBI and the CGI modules as well. The parameters for the DBI connection are set on entry to the program, and are being used by all the methods, so there is no difference there. The query itself only returns 27 rows, so I don't understand the reference to 128 headers. Has anyone any suggestions on what I might be able to do to fix it?
Thank you very much.
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.