View on
MetaCPAN is shutting down
For details read Perl NOC. After June 25th this page will redirect to
Mark Overmeer > XML-Compile-SOAP-Daemon > XML::Compile::SOAP::Daemon::NetServer



Annotate this POD



Open  0
View/Report Bugs
Module Version: 3.14   Source  


XML::Compile::SOAP::Daemon::NetServer - SOAP server based on Net::Server


   is a XML::Compile::SOAP::Daemon


 #### have a look in the examples directory!
 use XML::Compile::SOAP::Daemon::NetServer;
 use XML::Compile::SOAP11;
 use XML::Compile::SOAP::WSA;  # optional

 # Be warned that the daemon will be Net::Server based, which
 # consumes command-line arguments! "local @ARGV;" maybe useful
 my $daemon  = XML::Compile::SOAP::Daemon::NetServer->new;

 # daemon definitions from WSDL
 my $wsdl    = XML::Compile::WSDL11->new(...);
 $wsdl->importDefinitions(...); # more schemas
 $daemon->operationsFromWSDL($wsdl, callbacks => ...);

 # daemon definitions added manually (when no WSDL)
 my $soap11  = XML::Compile::SOAP11::Server->new(schemas => $wsdl->schemas);
 my $handler = $soap11->compileHandler(...);
 $daemon->addHandler('getInfo', $soap11, $handler);

 # see what is defined:

 # finally, run the server.  This never returns.


This module handles the exchange of SOAP messages over HTTP with Net::Server as daemon implementation, It uses HTTP::Request and HTTP::Response object provided by LWP, via functions provided by XML::Compile::SOAP::Daemon::LWPutil.

This abstraction level of the object (code in this pm file) is not concerned with parsing or composing XML, but only worries about the HTTP transport specifics of SOAP messages. The processing of the SOAP message is handled by the XML::Compile::SOAP::Daemon base-class.

The server is as flexible as possible: accept M-POST (HTTP Extension Framework) and POST (standard HTTP) for any message. It can be used for any SOAP1.1 and SOAP1.2 mixture. Although SOAP1.2 itself is not implemented yet.

Extends "DESCRIPTION" in XML::Compile::SOAP::Daemon.


Extends "METHODS" in XML::Compile::SOAP::Daemon.


Extends "Constructors" in XML::Compile::SOAP::Daemon.


Create the server handler, which extends some class which implements a Net::Server daemon. Any daemon configuration parameter should be passed with run(). This is a little tricky. Read below in the "Configuration options" section.

 -Option            --Defined in                --Default
  accept_slow_select  XML::Compile::SOAP::Daemon  <true>
  based_on                                        Net::Server::PreFork
  output_charset      XML::Compile::SOAP::Daemon  'UTF-8'
  soap_action_input   XML::Compile::SOAP::Daemon  {}
  wsa_action_input    XML::Compile::SOAP::Daemon  {}
  wsa_action_output   XML::Compile::SOAP::Daemon  {}
accept_slow_select => BOOLEAN
based_on => any Net::Server OBJECT|CLASS

You may pass your own Net::Server compatible daemon, if you feel a need to initialize it or prefer an other one. Preferrably, pass configuration settings to run(). You may also specify any Net::Server compatible CLASS name.

output_charset => STRING
soap_action_input => HASH|ARRAY
wsa_action_input => HASH|ARRAY
wsa_action_output => HASH|ARRAY


Extends "Attributes" in XML::Compile::SOAP::Daemon.


Inherited, see "Attributes" in XML::Compile::SOAP::Daemon

$obj->addWsaTable( <'INPUT'|'OUTPUT'>, [HASH|PAIRS] )

Inherited, see "Attributes" in XML::Compile::SOAP::Daemon


Inherited, see "Attributes" in XML::Compile::SOAP::Daemon

Running the server

Extends "Running the server" in XML::Compile::SOAP::Daemon.

$obj->process($client, $xmlin, $request, $action)

Inherited, see "Running the server" in XML::Compile::SOAP::Daemon


See Net::Server subroutine run, but the %options are passed as list, not as HASH. You may pass any option to which accepted by the Net::Server extension you are using.

 -Option     --Default
  postprocess  undef
postprocess => CODE

See the section about this option in the DETAILS chapter of the XML::Compile::SOAP::Daemon::LWPutil manual-page.


Extends "Preparations" in XML::Compile::SOAP::Daemon.

$obj->addHandler($name, $soap, CODE)

Inherited, see "Preparations" in XML::Compile::SOAP::Daemon

$obj->operationsFromWSDL($wsdl, %options)

Inherited, see "Preparations" in XML::Compile::SOAP::Daemon

$obj->setWsdlResponse( $filename, [$filetype] )

Inherited, see "Preparations" in XML::Compile::SOAP::Daemon


Extends "Helpers" in XML::Compile::SOAP::Daemon.


Inherited, see "Helpers" in XML::Compile::SOAP::Daemon


Inherited, see "Helpers" in XML::Compile::SOAP::Daemon


Inherited, see "Helpers" in XML::Compile::SOAP::Daemon

$obj->handlers( <'SOAP11'|'SOAP12'|$soap> )

Inherited, see "Helpers" in XML::Compile::SOAP::Daemon

$obj->printIndex( [$fh] )

Inherited, see "Helpers" in XML::Compile::SOAP::Daemon


Inherited, see "Helpers" in XML::Compile::SOAP::Daemon


Extends "DETAILS" in XML::Compile::SOAP::Daemon.

Operation handlers

Extends "Operation handlers" in XML::Compile::SOAP::Daemon.

Returning errors

Extends "Returning errors" in XML::Compile::SOAP::Daemon.

Configuration options

This module will wrap any kind of Net::Server, for instance a Net::Server::PreFork. It depends on the type of Net::Server you specify (see new(based_on)) which configuration options are available on the command-line, in a configuration file, or with run(). Each daemon extension implementation will add some configuration options as well.

Any XML::Compile::SOAP::Daemon::NetServer object will have the following additional configuration options:

  Key             Value             Default
  client_timeout  integer seconds   30
  client_maxreq   integer           100
  client_reqbonus integer seconds   0
  name            string            "soap daemon"

Some general configuration options of Net::Server have a different default. See also the next section about logging.

  Key             Value             New default
  setsid          boolean           true
  background      boolean           true

For each client, we like to have a reset of the connection after some time, for two reasons: perl processes are usually leaking memory a bit so should not live for ever, and you can experience denial of service attacks. The client_timeout value details the number of seconds a connection may live, but that will be increase by client_reqbonus for every received message. In any case, after client_maxreq messages were handled, the connection will be terminated.

The name is included in the reply messages.


An attempt is made to merge XML::Compile's Log::Report and Net::Server log configuration. By hijacking the log() method, all Net::Server internal errors are dispatched over the Log::Report framework. Log levels are translated into report reasons: 0=ERROR, 1=WARNING, 2=NOTICE, 3=INFO, 4=TRACE.

When you specify Sys::Syslog or a filename, default dispatchers of type SYSLOG resp FILE are created for you. When the log_file type is set to Log::Report, you have much more control over the process, but all log related configuration options will get ignored. In that case, you must have initialized the dispatcher framework the way Log::Report is doing it: before the daemon is initiated. See Log::Report subroutine dispatcher.

  Key          Value                            Default
  log_file     filename|Sys::Syslog|Log::Report Log::Report
  log_level    0..4 | REASON                    2 (NOTICE)


This module is part of XML-Compile-SOAP-Daemon distribution version 3.14, built on May 11, 2018. Website:


Copyrights 2007-2018 by [Mark Overmeer <>]. For other contributors see ChangeLog.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See

syntax highlighting: