=head1 NAME

XML::Compile::SOAP::HTTPDaemon - create SOAP over HTTP daemon

=head1 INHERITANCE

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

=head1 SYNOPSIS

 # See XML::Compile::SOAP::Daemon for an example, but even better:
 # have a look at the example enclosed in the distribution package.

=head1 DESCRIPTION

This module handles the exchange of (XML) messages over HTTP,
according to the rules of SOAP (any version).

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 creation and decoding
of the messages is handled by various L<XML::Compile::SOAP|XML::Compile::SOAP> components,
based on XML::Compile::Cache and L<XML::Compile|XML::Compile>.  The processing of
the message is handled by the L<XML::Compile::SOAP::Daemon|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.

=head1 METHODS

=head2 Constructors

XML::Compile::SOAP::HTTPDaemon-E<gt>B<new>(OPTIONS)

=over 4

See L<XML::Compile::SOAP::Daemon/"Constructors">

=back

=head2 Attributes

$obj-E<gt>B<outputCharset>

=over 4

See L<XML::Compile::SOAP::Daemon/"Attributes">

=back

=head2 Running the server

$obj-E<gt>B<process>(CLIENT, XMLIN)

=over 4

See L<XML::Compile::SOAP::Daemon/"Running the server">

=back

$obj-E<gt>B<run>(OPTIONS)

=over 4

See L<XML::Compile::SOAP::Daemon/"Running the server">

=back

=head2 Preparations

$obj-E<gt>B<addHandler>(NAME, SOAP, CODE)

=over 4

See L<XML::Compile::SOAP::Daemon/"Preparations">

=back

$obj-E<gt>B<operationsFromWSDL>(WSDL, OPTIONS)

=over 4

See L<XML::Compile::SOAP::Daemon/"Preparations">

=back

=head2 Handlers

$obj-E<gt>B<runRequest>(REQUEST, CONNECTION)

=over 4

Handle one REQUEST (HTTP::Request object), which was received from
the CLIENT (string).

=back

=head2 Helpers

$obj-E<gt>B<actionFromHeader>(REQUEST)

=over 4

Collect the soap action URI from the request, with C<undef> on failure.
Officially, the "SOAPAction" has no other purpose than the ability to
route messages over HTTP: it should not be linked to the portname of
the message (although it often can).

=back

$obj-E<gt>B<faultInvalidXML>(ERROR)

=over 4

See L<XML::Compile::SOAP::Daemon/"Helpers">

=back

$obj-E<gt>B<faultNotSoapMessage>(NODETYPE)

=over 4

See L<XML::Compile::SOAP::Daemon/"Helpers">

=back

$obj-E<gt>B<faultUnsupportedSoapVersion>(ENV_NS)

=over 4

See L<XML::Compile::SOAP::Daemon/"Helpers">

=back

$obj-E<gt>B<handlers>(('SOAP11'|'SOAP12'|SOAP))

=over 4

See L<XML::Compile::SOAP::Daemon/"Helpers">

=back

$obj-E<gt>B<printIndex>([FILEHANDLE])

=over 4

See L<XML::Compile::SOAP::Daemon/"Helpers">

=back

$obj-E<gt>B<protocolError>(STATUS, STATUS_TEXT, MESSAGE)

=over 4

See L<XML::Compile::SOAP::Daemon/"Helpers">

=back

$obj-E<gt>B<soapVersions>

=over 4

See L<XML::Compile::SOAP::Daemon/"Helpers">

=back

=head1 DETAILS

=head2 Configuration options

It depends on the type of Net::Server which you extend,
which options are available to you on the command-line
or in a configuration file.  L<XML::Compile::SOAP::Daemon|XML::Compile::SOAP::Daemon> adds and
changes some parameters as well.

Any C<XML::Compile::SOAP::HTTPDaemon> 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"

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 C<client_timeout> value details the number of seconds
a connection may live, but that will be increase by C<client_reqbonus>
for every received message.  In any case, after C<client_maxreq> messages
were handled, the connection will be terminated.

The C<name> is included in the reply messages.

=head3 logging

=head1 SEE ALSO

This module is part of XML-Compile-SOAP-Daemon distribution version 2.00,
built on February 12, 2009. Website: F<http://perl.overmeer.net/xml-compile/>

All modules in this suite:
L<XML::Compile>,
L<XML::Compile::SOAP>,
L<XML::Compile::SOAP12>,
L<XML::Compile::SOAP::Daemon>,
L<XML::Compile::Tester>,
L<XML::Compile::Cache>,
L<XML::Compile::Dumper>,
L<XML::Rewrite>,
and
L<XML::LibXML::Simple>.

Please post questions or ideas to the mailinglist at
F<http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/xml-compile>
For life contact with other developers, visit the C<#xml-compile> channel
on C<irc.perl.org>.

=head1 LICENSE

Copyrights 2007-2009 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 F<http://www.perl.com/perl/misc/Artistic.html>

