[Xml-compile] Daemon and PSGI

Mark Overmeer mark at overmeer.net
Wed Dec 15 08:40:17 GMT 2010


* Kaare Rasmussen (kaare at jasonic.dk) [101215 08:13]:
> Would it be feasible to make XML::Compile::SOAP::Daemon PSGI compliant?
> It would make it possible to use starman, feersum et al.

Short answer: no.

The whole idea of ::SOAP::Daemon to is to provide a high-level interface
to the end-user, where is not bothered by the HTTP messages at all. It
provides a SOAP interface on application level. The PSGI, on the other
hand, is only concerned about the HTTP messages, it's a transport
mechanism.
Besides, starman and feersum are daemon implementations, where
::SOAP::Daemon fully depends on Net::Server.  Actually: most of the code
of the ::Daemon distribution is only to control Net::Server daemon
implementation...

Alternative answer: possible

In a separate distribution, it would be quite easy to support PSGI.
A part of ::HTTPDaemon can be extracted, which packs and unpacks
HTTP messages.

Plack/PSGI and Catalyst offer a streaming benefit, between components of a
(web)server.  This does not work well for XML(::Compile) for two reasons:

   . You need the whole message before you can parse it (in theory,
     you can parse/interpret XML in streaming mode, but this is very
     difficult in a general case).  So, no streaming, only messaging.

   . Serialization of Perl into XML and back is quite expensive; it
     is much better to pass Perl structures around.

The standard ::SOAP distribution contains the logic to produce code
references for handlers. Glue these in a Plack HTTP transporter and
ready you are.
--
               MarkOv

------------------------------------------------------------------------
       Mark Overmeer MSc                                MARKOV Solutions
       Mark at Overmeer.net                          solutions at overmeer.net
http://Mark.Overmeer.net                   http://solutions.overmeer.net




More information about the Xml-compile mailing list