View on
ዳንኤል ያዕቆብ > SOAP-Lite-ActiveWorks-0.10 > SOAP::Transport::ACTIVEWORKS



Annotate this POD

View/Report Bugs
Module Version: 0.45   Source  


 SOAP::Transport::ACTIVEWORKS - Server/Client side ActiveWorks support for SOAP::Lite for Perl


 use SOAP::Lite +autodispatch =>
   uri      => 'activeworks://',
   proxy    => '',
   on_fault => sub { my($soap, $res) = @_;
     die ref $res ? $res->faultdetail : $soap->transport->status, "\n";

 print "Remote Time is ", ${ AdapterDevKit::timeRequest->SOAP::publish }{time}, "\n";


The SOAP::Transport::ACTIVEWORKS class provides support for ActiveWorks URIs to access ActiveWorks brokers through an HTTP proxy server with SOAP structured requests. The package also allows an ActiveWorks adapter to be used as a SOAP server to either invoke arbitrary Perl classes or to publish and return ActiveWorks events specified in a SOAP structure.

This class mirrors the interface of the SOAP::Transport::HTML class which should be referred to for general documentation. The URI differences will be discussed here with example usage.


The general schema of an ActiveWorks URI is as follows:

  activeworks://<broker>:<client group>@<host>:<port>

All parameters are optional and defaults can be set within the BEGIN section of the SOAP::Transport::ActiveWorks package. The assumed client group is always 'SOAP' and SOAP requests are forwarded to a SOAP adapter (server/ is provided) assumed to be running on the default broker.

If an alternative client group is specified the SOAP request is assumed to contain fields corresponding to a named ActiveWorks event available on the broker. See section PSEUDO EVENTS for details.


When using an HTTP server to proxy publish AW events the 'proxy' autodispatcher parameter should be set to your SOAP server URI as you would with a normal SOAP request.

 use SOAP::Lite +autodispatch =>
   uri      => 'urn:', # use default broker, client group, etc.
   proxy    => '',
   on_fault => sub { my($soap, $res) = @_;
     die ref $res ? $res->faultdetail : $soap->transport->status, "\n";

Note that the SOAP server, 'aw-soap' in this case, must be enabled to dispatch requests to an ActiveWorks handler. The provided Apache::AwSOAP module demonstrates this:

 package Apache::AwSOAP;

 use strict;
 use Apache;
 use SOAP::Transport::ACTIVEWORKS;

 my $server = SOAP::Transport::ACTIVEWORKS::Apache
    -> dispatch_to( '' );

 sub handler { $server->handler(@_); }


The client/ script demonstrates relaying a SOAP envelope from an http server to an ActiveWorks adapter for processing.

To work with your normal soap server, the AwGateway module may be used to relay an ordinary SOAP request as an ActiveWorks event to a broker specified in the autodispatcher 'uri' parameter. See section AwGateway.


The ACTIVEWORKS module along with the allows you to use an ActiveWorks broker as a SOAP server. Like a normal http server the SOAP adapter will instantiate and invoke the class and method specified in a SOAP request. In addition, classes may be mapped onto ActiveWorks events (see section PSEUDO CLASSES), mapped onto an adapter subroutine for special handling (see for a demonstration) and even relayed to an http SOAP server specified in the method URI (see for example usage).

The allows an ActiveWorks client to send and receive requests to a broker with a SOAP envelope to take advantage of the SOAP protocol in a purely ActiveWorks environment.


ActiveWorks events may be instantiated and published much like remote classes. With a 'pseudo class' we treat the remote event as if it were just another SOAP class that we want to access remotely.

The difference will be that we can only send a hash reference as an argument and always get a hash type in return (which is in keeping with the Aw package treatment of events as hashes). Also we publish the event with the dummy method '->publish'.

 use SOAP::Lite +autodispatch =>
   uri      => 'activeworks://',
   proxy    => '',
   on_fault => sub { my($soap, $res) = @_;
     die ref $res ? $res->faultdetail : $soap->transport->status, "\n";

  # Hash are used to transport ActiveWorks request event data:
  my %request = ();

  # Populate the event fields:
  $request{numbers} = \@Numbers;

  # Reset default publish timeout from 20 seconds:
  $request{_event_timeout} = 40000;

  # Publish event and force returned SOAPStruct type into a hash:
  my %results = %{ AdapterDevKit::calcRequest->SOAP::publish ( \%request ) };

The client script and demonstrate pseudo class usage.


The AwGateway module is a normal SOAP module that you would keep in your "Deployed Modules" directory. With AwGateway you access an ActiveWorks broker through your usual SOAP server and bi-pass the ACTIVEWORKS module altogether.

See the AwGateway full documentation and the accompanying client script demonstration use.


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


 See SOAP::Transport::HTTP


Copyright (C) 2000 Paul Kulchenko. All rights reserved.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.


The SOAP::Transport::ACTIVEWORKS module was developed by Daniel Yacob and is derived directly from SOAP::Transport::HTTP by Paul Kulchenko.

 Daniel Yacob,  L<|>
 Paul Kulchenko,  L<|>
syntax highlighting: