XML::Compile::SOAP::Daemon::NetServer - SOAP server based on Net::Server
XML::Compile::SOAP::Daemon::NetServer 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: $daemon->printIndex; # finally, run the server. This never returns. $daemon->run(@daemon_options);
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 {}
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.
Extends "Attributes" in XML::Compile::SOAP::Daemon.
Inherited, see "Attributes" in XML::Compile::SOAP::Daemon
Extends "Running the server" in XML::Compile::SOAP::Daemon.
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
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.
Inherited, see "Preparations" in XML::Compile::SOAP::Daemon
Extends "Helpers" in XML::Compile::SOAP::Daemon.
Inherited, see "Helpers" in XML::Compile::SOAP::Daemon
Extends "DETAILS" in XML::Compile::SOAP::Daemon.
Extends "Operation handlers" in XML::Compile::SOAP::Daemon.
Extends "Returning errors" in XML::Compile::SOAP::Daemon.
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.
Net::Server
Any XML::Compile::SOAP::Daemon::NetServer object will have the following additional configuration options:
XML::Compile::SOAP::Daemon::NetServer
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.
client_timeout
client_reqbonus
client_maxreq
The name is included in the reply messages.
name
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.
log()
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.
Sys::Syslog
log_file
Log::Report
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: http://perl.overmeer.net/CPAN/
Copyrights 2007-2018 by [Mark Overmeer <markov@cpan.org>]. 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 http://dev.perl.org/licenses/
To install XML::Compile::SOAP::Daemon, copy and paste the appropriate command in to your terminal.
cpanm
cpanm XML::Compile::SOAP::Daemon
CPAN shell
perl -MCPAN -e shell install XML::Compile::SOAP::Daemon
For more information on module installation, please visit the detailed CPAN module installation guide.