ዳንኤል ያዕቆብ > SOAP-Lite-ActiveWorks-0.10 > soap-lite-adapter.pl

Download:
SOAP-Lite-ActiveWorks-0.10.tar.gz

Annotate this POD

View/Report Bugs
Source  

NAME ^

 soap-lite-adapter.pl - SOAP Adapter for ActiveWorks Brokers

SYNOPSIS ^

 % ./soap-lite-adapter.pl &

DESCRIPTION ^

This script acts as a SOAP server for ActiveWorks brokers and is part of the SOAP-Lite-ActiveWorks distribution. This adapter can facilitate SOAP structured requests published by an ActiveWorks client application or forwarded from an HTTP server. The SOAP request may contain a URI for a Perl class and method to instantiate and invoke or may contain a URI for an ActiveWorks request to publish.

This adapter subscribes to the SOAP::Request event type and always replies with a SOAP::Reply event type. The event type and client group configuration needed is provided in the server/broker-config/soap.data file which should be imported and saved in your target broker using the ActiveWorks 'evtype_editor'. See the "README" file included with this package.

Traditional SOAP

To use the adapter as a SOAP server in the classic SOAP-Lite paradigm, install modules that you want accessible to the server in some 'SafeModules' directory. The simple 'server/SafeModules/Calculator' module has been provided for demonstration purposes.

With the adapter running you may access the 'Calculator' class with the native ActiveWorks Perl script client/aw-soap-aw-calculator.pl which uses a ActiveWorks broker as a proxy server (be sure to modify the 'proxy' autodispatcher parameter for your site).

The same 'Calculator' class may be accessed through an HTTP server when an ActiveWorks URI is used. The http-aw-soap-aw-calculator.pl script provides an example (again be sure to update the proxy server and uri hosts for your installation).

Finally, with the 'Calculator' class installed under an HTTP server, the aw-soap-aw-http-calculator.pl script demonstrates using an ActiveWorks proxy broker with an HTTP class URI.

Events as SOAP Accessible Classes

With a SOAP structured request the adapter may be used as a gateway broker to access events on a broker that may be unaccessible to the requesting client. The aw-soap-aw-aw-time.pl script demonstrates this when both an ActiveWorks 'proxy' and 'uri' parameters are used with the autodispatcher. This demonstration requires also the time_adapter.pl script that comes with the Aw module. Note that in this example we are treating ActiveWorks events as if they were deployed modules.

A '%safe_events' hash exists at the top of this the adapter. You may set in this hash the 'SafeEvents' that you want to grant access to. The hash is a table of event type names mapped to their respective URIs or a specified subroutine (see Callback Handlers next).

'Pseudo Classes' are similar in that they are ActiveWorks events treated as SOAP accessible classes on the client side. An ActiveWorks URI is specified for the class, but, the proxy server will publish a specified native ActiveWorks event type and not a SOAP::Request event type that would be received by this adapter. See the http-pseudo-aw-aw-calculator.pl and http-pseudo-aw-aw-time.pl for examples.

Callback Handlers

You may find it necessary to perform special operations for a given request or decide not to use the 'SafeModules' approach for some reason. The '%safe_events' hash will accept a mapping of an class or event type name to a code reference.

The http-callback-aw-aw-time.pl script demonstrates this usage, the request is handled in the 'handle_time_request' subroutine.

DEPENDENCIES ^

 The Aw package for Perl interfaces to ActiveWorks libraries.
 The SOAP-Lite package.
 The SOAP-Lite-ActiveWorks package. 
syntax highlighting: