[Xml-compile] XML::Compile::SOAP::Daemon::CGI and nph option for FastCGI

Immo Goltz immo at nothrix.org
Tue Apr 9 13:36:17 GMT 2019


Hello Mark,

it's me again having trouble running XML::Compile::SOAP::Daemon::CGI as 
FCGI process.
Long time ago with version 3.09 you implemented the -nph => BOOLEAN 
option. This works well.
Now I am back on the project and tried to fetch wsdl defined with 
$daemon->setWsdlResponse(filename).
Upon calling the soap service URL with ?WSDL attached the apache server 
complains with 500 and this log entry:
[proxy_fcgi:error] malformed header from script 'soap': Bad header: 
\t\t</xsd:complexT

I found that in CGI.pm sendWsdl method does set nph fix to 1. Changing 
it to 0 solved the problem.

I guess nph should be set like it is done in the _run method:
       , -nph     => ($args->{nph} ? 1 : 0)

What is your suggestion? For now I patched CGI.pm like this

--- CGI.pm.org	2018-05-10 23:05:25.000000000 +0000
+++ CGI.pm	2019-04-09 13:33:33.817705321 +0000
@@ -43,7 +43,7 @@
      my $ct     = $ENV{CONTENT_TYPE}   || 'text/plain';
      $ct =~ s/\;\s.*//;

-    return $self->sendWsdl($q)
+    return $self->sendWsdl($q, $args->{nph})
          if $method eq 'GET' && uc($qs) eq 'WSDL';

      my ($rc, $msg, $err, $mime, $bytes);
@@ -104,15 +104,14 @@
      close WSDL;
  }

-sub sendWsdl($)
-{   my ($self, $q) = @_;
+sub sendWsdl($,$)
+{   my ($self, $q, $nph) = @_;

      print $q->header
        ( -status  => RC_OK.' WSDL specification'
        , -type    => $self->{wsdl_type}
        , -charset => 'utf-8'
-      , -nph     => 1
-
+      , -nph     => ($nph ? 1 : 0)
        , -Content_length => length($self->{wsdl_data})
        );

Thank you in advance
Immo




More information about the Xml-compile mailing list