Hi

I am working on a simple SOAP server using the following code:
#!/usr/bin/env perl
#
use strict;
use warnings;
use Log::Report 'DEBUG';
use XML::Compile::SOAP::Daemon::CGI;
use XML::Compile::SOAP::Daemon::AnyDaemon;
use XML::Compile::SOAP::Operation;
use XML::Compile::SOAP11;
use XML::Compile::WSDL11;
use XML::Compile::Util qw/pack_type/;
use Data::Dumper;
use Getopt::Long;
use File::Basename qw/basename/;
use HTTP::Status   qw/:constants/;

my $wsdlfile = "HelloService.wsdl";

my $mode = 2;
my $port = 4444;
my $host = '127.0.0.1';
my($live, $test) = (0, 0);

GetOptions
    'v+'        => \$mode,
    'verbose=i'    => \$mode,
    'port|p=i'    => \$port,
    'host|h=s'    => \$host,
    'mode=s'    => \$mode,
    'live!'        => \$live,
    'test!'        => \$test
    or error "Deamon is not started";

error __x"No filenames expected on the command-line"
    if @ARGV;

dispatcher PERL => 'default', mode => $mode;

my $daemon = XML::Compile::SOAP::Daemon::AnyDaemon->new;
my $wsdl = XML::Compile::WSDL11->new($wsdlfile);

$daemon->operationsFromWSDL( $wsdl,
    handlers => { sayHello => \&handle_sayHello }
 );

$daemon->setWsdlResponse($wsdlfile);

dispatcher SYSLOG => 'syslog', mode => $mode;
dispatcher close  => 'default';   # close errors to stdout

info __x"starting daemon in {envir} environment"
  , envir => ($live ? 'live' : 'test');

$daemon->printIndex;

$daemon->run(
        name    => basename($0),
        host    => $host,
        port    => $port,
        background => 0
    );

info "Daemon stopped";
exit 0;

With the following wsdl file:

cat HelloService.wsdl
<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions name="HelloService"
   targetNamespace="http://127.0.0.1/wsdl/HelloService.wsdl";
   xmlns="http://schemas.xmlsoap.org/wsdl/";
   xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/";
   xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";
   xmlns:tns="http://127.0.0.1/wsdl/HelloService.wsdl";
   xmlns:xsd="http://www.w3.org/2001/XMLSchema";>

   <wsdl:message name="SayHelloRequest">
      <wsdl:part name="firstName" type="xsd:string"/>
   </wsdl:message>
   <wsdl:message name="SayHelloResponse">
      <wsdl:part name="greeting" type="xsd:string"/>
   </wsdl:message>

   <wsdl:portType name="Hello_PortType">
      <wsdl:operation name="sayHello">
         <wsdl:input message="tns:SayHelloRequest"/>
         <wsdl:output message="tns:SayHelloResponse"/>
      </wsdl:operation>
   </wsdl:portType>

   <wsdl:binding name="Hello_Binding" type="tns:Hello_PortType">
      <soap:binding style="rpc" transport="
http://schemas.xmlsoap.org/soap/http"; />
      <wsdl:operation name="sayHello">
        <soap:operation soapAction="sayHello" />
        <wsdl:input>
           <soap:body namespace="urn:examples:helloservice" />
        </wsdl:input>
        <wsdl:output>
           <soap:body
              namespace="urn:examples:helloservice"
              />
        </wsdl:output>
      </wsdl:operation>
   </wsdl:binding>

   <wsdl:service name="Hello_Service">
      <wsdl:port binding="tns:Hello_Binding" name="Hello_Port">
          <soap:address location="http://127.0.0.1:4444/SayHello"; />
      </wsdl:port>
   </wsdl:service>
</wsdl:definitions>

When it runs and I call it I get the following error messages:
./SoapServer.pl --live
info: added 1 operations from WSDL
info: switching to run mode 2, accept ASSERT-
SOAP11:
   sayHello
Use of uninitialized value $maxmsgs in numeric eq (==) at
/usr/local/perl5.16.3/lib/site_perl/5.16.3/XML/Compile/SOAP/Daemon/LWPutil.pm
line 97.
Use of uninitialized value $reqbonus in addition (+) at
/usr/local/perl5.16.3/lib/site_perl/5.16.3/XML/Compile/SOAP/Daemon/LWPutil.pm
line 101.


Can anybody help me further?
-- 
Kind regards

Theo
_______________________________________________
Xml-compile mailing list
[email protected]
http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/xml-compile

Reply via email to