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