W3C::SOAP::WSDL::Parser - Parses WSDL documents to generate Perl client libraries to access the Web Service defined.
This documentation refers to W3C::SOAP::WSDL::Parser version 0.14.
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
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>>
load_wsdl(...)
<W3C::SOAP::WSDL-
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.
use
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().
<Module-
load_wsdl()
load_wsdl ($location)
Helper method that takes the supplied location and creates the dynamic WSDL client object.
new (%args)
Create the new object new accepts the following arguments:
new
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.
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.
The library directory where modules should be stored. only required when calling write_modules
write_modules
The Template Toolkit object used for the generation of on static modules when using the "write_modules" method.
The mapping of XSD namespaces to perl Modules.
<$wsdl-
Writes out a module that is a SOAP Client to interface with the contained WSDL document, also writes any referenced XSDs.
Creates a dynamic SOAP client object to talk to the WSDL this object was created for
Creates the W3C::SOAP::XSD::Parser object that represents the XSDs that are used by the specified WSDL file.
There are no known bugs in this module.
Please report problems to Ivan Wills (ivan.wills@gmail.com).
Patches are welcome.
Ivan Wills - (ivan.wills@gmail.com)
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.
To install W3C::SOAP, copy and paste the appropriate command in to your terminal.
cpanm
cpanm W3C::SOAP
CPAN shell
perl -MCPAN -e shell install W3C::SOAP
For more information on module installation, please visit the detailed CPAN module installation guide.