NAME
W3C::SOAP::WSDL::Parser - Parses WSDL documents to generate Perl client libraries to access the Web Service defined.
VERSION
This documentation refers to W3C::SOAP::WSDL::Parser version 0.14.
SYNOPSIS
use W3C::SOAP::WSDL::Parser qw/load_wsdl/;
# quick/simple usage
# create a SOAP client
$url = 'http://example.com/soap.wsdl';
my $client = load_wsdl($url);
my $result = $client->some_action(...);
# Create a new object
my $wsdl = W3C::SOAP::WSDL::Parser->new(
location => $url,
module => 'MyApp::WSDL',
lib => './lib',
template => Template->new(...),
ns_module_map => {
'http://example.com/xsd/namespace' => 'MyAPP::XSD::Example',
'some.other.namespace' => 'MyApp::XSD::SomeOther',
},
);
# Write the generated WSDL module to disk
$wsdl->write_modules();
# may generate the files
# lib/MyApp/WSDL.pm
# lib/MyApp/XSD/Example.pm
# lib/MyApp/XSD/SomeOther.pm
DESCRIPTION
This module parses a WSDL file so that it can produce a client to talk to the SOAP service.
There are two ways of using this file:
Dynamic :
load_wsdl(...)
or<W3C::SOAP::WSDL-
new()->dynamic_classes>>These return an in memory generated WSDL client which you can use to talk to the specified web service.
Static :
<W3C::SOAP::WSDL-
new()->write_modules()>> or use wsdl-parser command line script.This writes perl modules to disk so that you can
use
the modules in your later. This has the advantage that you don't have to recompile the WSDL every time you run your code but it has the disadvantage that your client may be out of date compared to the web service's WSDL.
Both interfaces are identical once you have the client object. If you want to change at a later point the code change should be adding or removing a use statement and switching from a <Module-
new>> to load_wsdl()
.
SUBROUTINES/METHODS
EXPORTED SUBROUTINES
load_wsdl ($location)
-
Helper method that takes the supplied location and creates the dynamic WSDL client object.
CLASS METHODS
new (%args)
-
Create the new object
new
accepts the following arguments:- location
-
This is the location of the WSDL file, it may be a local file or a URL, it is used to create the
document
attribute if not supplied. - document
-
A W3C::SOAP::Document object representing the WSDL file.
- module
-
This is the name of the module to be generated, it is required when writing the SOAP client to disk, the dynamic client generator creates a semi random namespace.
- lib
-
The library directory where modules should be stored. only required when calling
write_modules
- template
-
The Template Toolkit object used for the generation of on static modules when using the "write_modules" method.
- ns_module_map
-
The mapping of XSD namespaces to perl Modules.
OBJECT METHODS
<$wsdl-
write_modules ()>>-
Writes out a module that is a SOAP Client to interface with the contained WSDL document, also writes any referenced XSDs.
<$wsdl-
dynamic_classes ()>>-
Creates a dynamic SOAP client object to talk to the WSDL this object was created for
<$wsdl-
get_xsd ()>>-
Creates the W3C::SOAP::XSD::Parser object that represents the XSDs that are used by the specified WSDL file.
DIAGNOSTICS
CONFIGURATION AND ENVIRONMENT
DEPENDENCIES
INCOMPATIBILITIES
BUGS AND LIMITATIONS
There are no known bugs in this module.
Please report problems to Ivan Wills (ivan.wills@gmail.com).
Patches are welcome.
AUTHOR
Ivan Wills - (ivan.wills@gmail.com)
LICENSE AND COPYRIGHT
Copyright (c) 2012 Ivan Wills (14 Mullion Close, Hornsby Heights, NSW Australia 2077). All rights reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.