7 use Apache2::Const -compile => qw(OK :log :http :methods :cmd_how :override);
8 use Apache2::RequestRec ();
9 use Apache2::RequestIO ();
14 return Apache2::Const::HTTP_METHOD_NOT_ALLOWED unless $r->method_number eq Apache2::Const::M_POST;
16 my $NCIPConfigFile = $r->dir_config('NCIPConfigFile');
18 if (!defined($NCIPConfigFile)) {
19 die sprintf "error: There is no NCIPConfigFile defined\n";
21 if (! (-r $NCIPConfigFile)) {
22 die sprintf "error: NCIPConfigFile %s does not exist or is not readable\n", $NCIPConfigFile;
26 my $ncip = NCIP->new($NCIPConfigFile);
28 $r->content_type('text/html');
32 while ($r->read($tmp_buf, 1024)) {
33 $input_xml .= $tmp_buf;
36 my $response_xml = $ncip->process_request($input_xml);
38 $r->print($response_xml);
39 return Apache2::Const::OK;