Loading ...
Sorry, an error occurred while loading the content.

2602Sevices through WSDL file on Apache

Expand Messages
  • John Ralston
    May 8, 2003
    • 0 Attachment
      This may be as much my ignorance of Linux and/or Apache as much as it is a SoapLite problem for me, but I'll appreciate any guidance and instruction. I have a service //lbox/cgi-bin/echo.cgi on system with Redhat Linux 7.2 and Apache 1.3 that dispatches to //lbox/cgi-bin/Echo.pm. When I call methods on this service from a Windows machine with a Perl script that uses the proxy=http://lbox/cgi-bin/echo.cgi, all works fine. When I invoke the service through a WSDL file stored on the client (which is Win95), the service works well, too.

      However, if the same WSDL file is stored on the Apache server and invoked, I get errors. Here is the code:


      #!perl -w
      print "Started . . .\n";
      use SOAP::Lite+trace=>'debug';
      open STDERR, '>', "error.log";
      my $phrase = shift;
      print SOAP::Lite->service('file://lbox/cgi-bin/echo_lbox.wsdl')->echo($phrase), "\n";
      print SOAP::Lite->service('file://lbox/cgi-bin/echo_lbox.wsdl')->hail(), "\n";
      print "Done.\n";

      generates error.log:

      Service description 'file://lbox/cgi-bin/echo_lbox.wsdl' can't be loaded: 404 File `\\lbox\cgi-bin\echo_lbox.wsdl' does not exist

      #-------------------------------------------

      #!perl -w
      print "Started . . .\n";
      use SOAP::Lite+trace=>'debug';
      open STDERR, '>', "error.log";
      my $phrase = shift;
      print SOAP::Lite->service('http://lbox/cgi-bin/echo_lbox.wsdl')->echo($phrase), "\n";
      print SOAP::Lite->service('http://lbox/cgi-bin/echo_lbox.wsdl')->hail(), "\n";
      print "Done.\n";

      generates error.log:

      Service description 'http://lbox/cgi-bin/echo_lbox.wsdl' can't be loaded: 500 Internal Server Error

      and Apache error_log says:

      Exec format error: exec of /var/www/cgi-bin/echo_lbox.wsdl failed
      Premature end of script headers: /var/www/cgi-bin/echo_lbox.wsdl

      #-------------------------------------------

      I've set all the permissions for echo_lbox.wsdl. I've tried various combinations of capitalization. The wsdl file works OK with the same service set up on a Win98 machine with PWS, so I don't think the WSDL is bad. But here it is anyway:

      <?xml version="1.0" encoding="UTF-8"?>
      <definitions
      name="Echo"
      targetNamespace="Echo"
      xmlns="http://schemas.xmlsoap.org/wsdl/"
      xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
      xmlns:tns="http://lbox/cgi-bin/Echo"
      xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <message name="HailResponse">
      <part name="return" type="xsd:string"/>
      </message>
      <message name="HailRequest"> </message>
      <message name="EchoResponse">
      <part name="return" type="xsd:string"/>
      </message>
      <message name="EchoRequest">
      <part name="text" type="xsd:string"/>
      </message>
      <portType name="EchoPort">
      <operation name="echo" parameterOrder="text arg1">
      <input message="tns:EchoRequest"/>
      <output message="tns:EchoResponse"/>
      </operation>
      <operation name="hail">
      <input message="tns:HailRequest"/>
      <output message="tns:HailResponse"/>
      </operation>
      </portType>
      <binding name="EchoBinding" type="tns:EchoPort">
      <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
      <operation name="echo">
      <soap:operation soapAction="Echo#echo"/>
      <input>
      <soap:body
      encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
      namespace="Echo"
      parts="text"
      use="encoded"/>
      </input>
      <output>
      <soap:body
      encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
      namespace="Echo"
      use="encoded"/>
      </output>
      </operation>
      <operation name="hail">
      <soap:operation soapAction="Echo#hail"/>
      <input>
      <soap:body
      encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
      namespace="Echo"
      use="encoded"/>
      </input>
      <output>
      <soap:body
      encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
      namespace="Echo"
      parts="return"
      use="encoded"/>
      </output>
      </operation>
      </binding>
      <service name="Echo">
      <port binding="tns:EchoBinding" name="EchoPort">
      <soap:address location="http://lbox/cgi-bin/echo.cgi"/>
      </port>
      </service>
      </definitions>

      tia for any help.

      John