2 package NCIPServer::NCIPResponder;
8 use Apache2::Const -compile => qw(OK :log :http :methods :cmd_how :override);
9 use Apache2::RequestRec ();
10 use Apache2::RequestIO ();
16 return Apache2::Const::HTTP_METHOD_NOT_ALLOWED unless $r->method_number eq Apache2::Const::M_POST;
18 my $NCIPConfigFile = $r->dir_config('NCIPConfigFile');
20 if (!defined($NCIPConfigFile)) {
21 die sprintf "error: There is no NCIPConfigFile defined\n";
23 if (! (-r $NCIPConfigFile)) {
24 die sprintf "error: NCIPConfigFile %s does not exist or is not readable\n", $NCIPConfigFile;
28 my $ncip = NCIPServer::NCIP->new($NCIPConfigFile);
30 $r->content_type('text/html');
34 while ($r->read($tmp_buf, 1024))
36 $input_xml .= $tmp_buf;
39 my $response_xml = $ncip->process_request($input_xml);
41 $r->print($response_xml);
42 return Apache2::Const::OK;