Quick Start Guide with SOAP Part Two

Table of Contents

Quick Start with SOAP Part I

More Complex Server (daemon, mod_perl and mod_soap)

Access to Remote Services

Access With Service Description (WSDL)

Security (SSL, basic/digest authentication, cookie-based authentication, ticket-based authentication, access control)

Handling LoLs (List of Lists, Structs, Objects, or something else)

More Complex Server (daemon, mod_perl and mod_soap)

You shouldn’t have many problems with the CGI-based SOAP server you created in the first part of this article; however, performance could be significantly better. The next logical step might be to implement SOAP services using accelerators (like PerlEx or VelociGen) or persistent technologies (like mod_perl). Another lightweight solution might be to implement the SOAP service as an HTTP daemon; in that case, you don’t need to use a separate Web server. This might be useful in a situation where a client application accepts SOAP calls, or for internal usage.

HTTP daemon

The following code shows an example implementation for a HTTP daemon:

4.a. server (HTTP daemon)

 #!perl -w

  use SOAP::Transport::HTTP;

  use Demo;

  # don't want to die on 'Broken pipe' or Ctrl-C
  $SIG{PIPE} = $SIG{INT} = 'IGNORE';

  $daemon = SOAP::Transport::HTTP::Daemon
    -> new (LocalPort => 80)
    -> dispatch_to('/home/soaplite/modules')
  ;

  print "Contact to SOAP server at ", $daemon->url, "\n";
  $daemon->handle;

Tags

Feedback

Something wrong with this article? Help us out by opening an issue or pull request on GitHub