SOAP::WSDL::Build - Module::Build subclass for running wsdl2perl during build
In your Build.PL:
use SOAP::WSDL::Build; my $build = SOAP::WSDL::Build->new( wsdl2perl => { location => 'wsdl/foo.wsdl', prefix => 'SupaModule::', } ); $build->generate_build_script();
On building/installing:
perl Build.PL perl Build perl Build test perl Build install
Module::Build subclass for running wsdl2perl during the build stage. This allows shipping of distributions based on SOAP::WSDL, which do not include generated code, but the WSDLs in question instead.
To use SOAP::WSDL::Build in your Build.PL scripts, do the following:
Use SOAP::WSDL::Build instead of Module::Build
use SOAP::WSDL::Build; my $build = SOAP::WSDL::Build->new(%options); $build->generate_build_script();
All standard Module::Build methods are still available.
Add the wsdl2perl configuration under the options key wsdl2perl:
my $build = SOAP::WSDL::Build->new( ... wsdl2perl => { location => 'path/to/wsdl', server => 1, client => 0, prefix => 'My::Project::' } );
SOAP::WSDL::Builder accepts the following options in the wsdl2perl hash reference:
Frequently used options
location
Path to WSDL file. Required.
prefix
Prefix to apply to all generated classes.
client
Generate client interfaces. Defaults to 1 (true)
server
Generate server interfaces. Defaults to 0 (false)
types
Generate data classes. Defaults to 1 (true)
silent
Don't tell what's being generated. Defaults to 0 (false)
Less frequently used options for the generation process
use_typemap
Generate a typemap based parser. This option is only for compatibility with 2.00.xx versions and should not be used in any other case. Defaults to 0 (false)
typemap_include
Code snippet to include in typemap. This option is only for compatibility with 2.00.xx versions and should not be used in any other case. Defaults to q{} (empty string)
attribute_prefix
Individual attribute prefix. Defaults to "$prefix\Attributes"
interface_prefix
Individual (client) interface prefix. Defaults to "$prefix\Interfaces"
server_prefix
Individual server prefix. Defaults to "$prefix\Server"
type_prefix
Individual (data) type prefix. Defaults to "$prefix\Types"
element_prefix
Individual (data) element prefix. Defaults to "$prefix\Elements"
typemap_prefix
Individual typemap prefix. Defaults to "$prefix\Typemaps"
Options controlling LWP::UserAgent
Use of these options is strongly discouraged for published distributions, as it may make the distribution dependent on your environment
proxy
HTTP(s) proxy to use. Proxies can also be set ussing the HTTP_PROXY and HTTPS_PROXY environment variables, which is generally a better choice for build scripts.
keepalive
Keppalive is only required in combination with NTLM authentication. It is not recommended to create distributions which rely on protected documents, so it's somewhat useless for use in Build scripts.
SOAP::WSDL::Build modifies the standard "build" target (invoked when running "perl Build") to include the target "webservice".
SOAP::WSDL::Build adds the new target webservice. This build target generates perl classes from the WSDL definitions specified.
You may run this step separately by calling
perl Build webservice
$builder->wsdl2perl(%config);
An example is located in the distribution's examples directory in
examples/dist
Copyright 2004-2009 Martin Kutter.
This file is part of SOAP-WSDL. You may distribute/modify it under the same terms as perl itself
Martin Kutter <martin.kutter fen-net.de>
$Rev: 849 $ $LastChangedBy: kutterma $ $Id: Build.pm 849 2009-05-15 21:39:29Z kutterma $ $HeadURL: http://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/branches/Typemap/lib/SOAP/WSDL/Build.pm $
To install SOAP::WSDL, copy and paste the appropriate command in to your terminal.
cpanm
cpanm SOAP::WSDL
CPAN shell
perl -MCPAN -e shell install SOAP::WSDL
For more information on module installation, please visit the detailed CPAN module installation guide.