Package Generator generates a PHP SDK from any WSDL.
Package Generator generates a PHP SDK from any WSDL so you can easily consume any SOAP Web Service without wondering how SOAP is used under the hood.
Package Generator provides many options to generate your package even if a few are required. This project has been tested with many WSDL and is currently used on the platform Providr.IO.
composer require wsdltophp/packagegenerator
$ wget https://phar.wsdltophp.com/wsdltophp-php5.phar
$ chmod +x wsdltophp-php5.phar
$ mv wsdltophp-php5.phar /usr/local/bin/wsdltophp
$ wget https://phar.wsdltophp.com/wsdltophp-php7.phar
$ chmod +x wsdltophp-php7.phar
$ mv wsdltophp-php7.phar /usr/local/bin/wsdltophp
There is two ways to generate your package (apart from being in a project and generating it through the command line):
- standalone (default behaviour): this means the package is generated as an independent project with its own
composer.json
file. At the end of the generation, the root directory where the package has been generated will contain thecomposer.json
, thecomposer.lock
file and thevendor
directory. - not standalone: this means the package is generated as part of an existing project using its own
composer.json
file.
The standalone
option is fully detailed in the Standalone section.
All the options are fully detailed in the Options page.
// Options definition: the configuration file parameter is optional
$options = GeneratorOptions::instance(/* '/path/file.yml' */);
$options
->setOrigin('http://developer.ebay.com/webservices/latest/ebaySvc.wsdl')
->setDestination('./MySdk')
->setComposerName('myproject/mysdk');
// Generator instanciation
$generator = new Generator($options);
// Package generation
$generator->generatePackage();
The command line is:
$ wsdltophp generate:package \
--urlorpath="http://developer.ebay.com/webservices/latest/ebaySvc.wsdl" \
--destination="./MySdk" \
--composer-name="myproject/mysdk" \
--force
In order to see all the used options, just remove the --force
argument.
# launch all tests
$ phpunit
# launch a testsuite: command, configuration, utils, wsdlhandler, model, container, parser, file, packagegenerator
$ phpunit --testsuite=model
Please see CONTRIBUTING for details. In addition, code documentation is at doc.wsdltophp.com.
Developers who helped on this project are listed in the composer.json file as Contributor
and are:
If you have any question, please read the Options page about the available options to generate the package.
There is also a FAQ that contains miscellaneous questions about the package generation and its usage.
Then if you still have a question, feel free to create an issue.
The MIT License (MIT). Please see License File for more information.