SOAP::Transport::ActiveWorks::AutoInvoke::Client - Automarshall methods for Perl SOAP
#!/usr/bin/perl -w # # Client example that goes with server example # in SOAP::Transport::ActiveWorks::AutoInvoke::Client # use strict; package Calculator; use base qw( SOAP::Transport::ActiveWorks::AutoInvoke::Client ); package main; my $calc = new Calculator; print "sum = ", $calc->add ( 1, 2, 3 ), "\n";
The intention of the AutoInvoke package is to allow a SOAP client to use a remote class as if it were local. The remote package is treated as local with a declaration like:
package MyClass; use base qw( SOAP::Transport::ActiveWorks::AutoInvoke::Client );
The SOAP::AutoInvoke base class will "Autoload" methods called from an instance of "MyClass", send it to the server side, and return the results to the caller's space.
The 'new' method may be called with option arguments to reset variables from the defaults.
my $class = new MyClass ( _soap_host => 'anywhere.com', _soap_port => 8849, _soap_client_group => 'NotSOAP', _soap_method_uri => 'urn:com-name-your' );
It is advisable to set the package defaults at installation time in the SOAP/Transport/ActiveWorks/AutoInvoke/Client.pm (this) file. The variables may also be reset after instantiation with the 'set' methods.
The '_soap_' variable is relevant only to the local instantiation of "MyClass". The remote instantiation will call "new" with any arguments you have passed to the local instantiation that did not begin with '_soap_':
my $class = new MyClass ( _soap_host => 'anywhere.com', arg1, arg2, @arg3, arg4 => $value, : );
This works so long as the data types being passed are something the SOAP package can serialize. SOAP::AutoInvoke can send and receive simple arrays.
To reset the name of the "new" to be called remotely:
my $class = new MyClass ( : _soap_new_method => 'create', : );
To not call any new method remotely:
my $class = new MyClass ( : _soap_new_method => undef, : );
returns the contents of $class->{_soap_host}.
sets the contents of $class->{_soap_host}.
returns the contents of $class->{_soap_port}.
sets the contents of $class->{_soap_port}.
returns the contents of $class->{_soap_broker}.
sets the contents of $class->{_soap_broker}.
returns the contents of $class->{_soap_client_group}.
sets the contents of $class->{_soap_client_group}.
returns the contents of $class->{_soap_method_uri}.
sets the contents of $class->{_soap_method_uri}.
returns the contents of $class->{_soap_new_args}.
sets the contents of $class->{_soap_new_args}.
returns the contents of $class->{_soap_new_method}.
sets the contents of $class->{_soap_new_method}. The default is "new".
SOAP-0.28 SOAP::Transport::ActiveWorks Data::Dumper
Daniel Yacob, yacob@rcn.com
perl(1). SOAP(3). SOAP::Transport::ActiveWorks::AutoInvoke::Server(3).
2 POD Errors
The following errors were encountered while parsing the POD:
'=item' outside of any '=over'
You forgot a '=back' before '=head1'
To install Calculator, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Calculator
CPAN shell
perl -MCPAN -e shell install Calculator
For more information on module installation, please visit the detailed CPAN module installation guide.