ዳንኤል ያዕቆብ > SOAP-AutoInvoke-0.25 > SOAP::AutoInvoke

Download:
SOAP-AutoInvoke-0.25.tar.gz

Annotate this POD

View/Report Bugs
Source  

NAME ^

SOAP::AutoInvoke - Automarshall methods for Perl SOAP

SYNOPSIS ^

 #!/usr/bin/perl -w

 #
 #  Client example that goes with server example
 #  in SOAP::Transport::HTTP::AutoInvoke
 #
 use strict;

 package Calculator;
 use base qw( SOAP::AutoInvoke );


 package main;

 my $calc = new Calculator;


 print "sum = ", $calc->add ( 1, 2, 3 ), "\n";

DESCRIPTION ^

The intention of SOAP::AutoInvoke 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::AutoInvoke );

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.

Provided Methods

new:

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       => 80,
                  _soap_endpoint   => 'soapx?class=OtherClass',
                  _soap_method_uri => 'urn:com-name-your'
              );

It is advisable to set the package defaults at installation time in the SOAP/Transport/HTTP/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,
                  :
              );
_soap_get_host:

returns the contents of $class->{_soap_host}.

_soap_set_host:

sets the contents of $class->{_soap_host}.

_soap_get_port:

returns the contents of $class->{_soap_port}.

_soap_set_port:

sets the contents of $class->{_soap_port}.

_soap_get_endpoint:

returns the contents of $class->{_soap_endpoint}.

_soap_set_endpoint:

sets the contents of $class->{_soap_endpoint}.

_soap_get_method_uri:

returns the contents of $class->{_soap_method_uri}.

_soap_set_method_uri:

sets the contents of $class->{_soap_method_uri}.

_soap_get_new_args:

returns the contents of $class->{_soap_new_args}.

_soap_set_new_args:

sets the contents of $class->{_soap_new_args}.

_soap_get_new_method:

returns the contents of $class->{_soap_new_method}.

_soap_set_new_method:

sets the contents of $class->{_soap_new_method}. The default is "new".

DEPENDENCIES ^

SOAP-0.28 Data::Dumper

AUTHOR ^

Daniel Yacob, yacob@rcn.com

SEE ALSO ^

perl(1). SOAP(3). SOAP::Transport::HTTP::AutoInvoke(3).

syntax highlighting: