wsdltophp / packagegenerator
Generate hierarchical PHP classes based on a WSDL
Installs: 1 343 269
Dependents: 16
Suggesters: 0
Security: 0
Stars: 428
Watchers: 18
Forks: 73
Open Issues: 22
Requires
- php: >=7.4
- ext-dom: *
- ext-json: *
- ext-libxml: *
- ext-mbstring: *
- ext-soap: *
- composer/composer: ^2.0
- symfony/console: ^4.0|^5.0|^6.0|^7.0
- symfony/yaml: ^4.0|^5.0|^6.0|^7.0
- wsdltophp/packagebase: ^5.0
- wsdltophp/phpgenerator: ^4.0
- wsdltophp/wsdlhandler: ^1.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.0
- phpstan/phpstan: ^1.3
- phpunit/phpunit: ^9
- rector/rector: ^0.15.17
- dev-develop
- 4.1.13
- 4.1.12
- 4.1.11
- 4.1.10
- 4.1.9
- 4.1.8
- 4.1.7
- 4.1.6
- 4.1.5
- 4.1.4
- 4.1.3
- 4.1.2
- 4.1.1
- 4.1.0
- 4.0.2
- 4.0.1
- 4.0.0
- 4.0.0-rc.2
- 4.0.0-rc.1
- 3.x-dev
- 3.4.2
- 3.4.1
- 3.4.0
- 3.3.7
- 3.3.6
- 3.3.5
- 3.3.4
- 3.3.3
- 3.3.2
- 3.3.1
- 3.3.0
- 3.2.7
- 3.2.6
- 3.2.5
- 3.2.4
- 3.2.3
- 3.2.2
- 3.2.1
- 3.2.0
- 3.1.0
- 3.0.4
- 3.0.3
- 3.0.2
- 3.0.1
- 3.0.0
- 2.x-dev
- 2.12.4
- 2.12.3
- 2.12.2
- 2.12.1
- 2.12.0
- 2.11.7
- 2.11.6
- 2.11.5
- 2.11.4
- 2.11.3
- 2.11.2
- 2.11.1
- 2.11.0
- 2.10.0
- 2.9.5
- 2.9.4
- 2.9.3
- 2.9.2
- 2.9.1
- 2.9.0
- 2.8.5
- 2.8.4
- 2.8.3
- 2.8.2
- 2.8.1
- 2.8.0
- 2.7.3
- 2.7.2
- 2.7.1
- 2.7.0
- 2.6.1
- 2.6.0
- 2.5.1
- 2.5.0
- 2.4.1
- 2.4.0
- 2.3.1
- 2.3.0
- 2.2.0
- 2.1.0
- 2.0.1
- 2.0.0
- 1.11.1
- 1.11.0
- 1.10.1
- 1.10.0
- 1.9.1
- 1.9.0
- 1.8.1
- 1.8.0
- 1.7.0
- 1.6.0
- 1.5.1
- 1.5.0
- 1.4.3.1
- 1.4.3
- 1.4.2
- 1.4.1
- 1.4.0
- 1.3.1
- 1.3.0
- 1.2.0
- 1.1.3
- 1.1.2
- 1.1.1
- 1.1.0
- 1.0.0
- 1.0.0rc04
- 1.0.0RC03
- 1.0.0rc02
- 1.0.0rc01
- 0.0.5
- 0.0.4
- 0.0.3
- 0.0.2
- dev-superbiche-superbiche-patch-280
- dev-feature/sonars
- dev-master
- dev-feature/issue-312
- dev-feature/issue-298
- dev-feature/issue-254
This package is auto-updated.
Last update: 2024-12-09 20:39:08 UTC
README
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.
Package Generator generates files that are detailed in the MANIFEST. You are encouraged to read it to understand how and why the files are generated in addition to the way the generated classes are supposed to be used.
Installation
In a project:
composer require wsdltophp/packagegenerator --dev
With command line:
$ wget https://phar.wsdltophp.com/wsdltophp-php7.phar $ chmod +x wsdltophp-php7.phar $ mv wsdltophp-php7.phar /usr/local/bin/wsdltophp
With Docker:
$ docker run --rm -it mikaelcom/wsdltophp:tagname
Usage
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.
In a project:
use WsdlToPhp\PackageGenerator\ConfigurationReader\GeneratorOptions; use WsdlToPhp\PackageGenerator\Generator\Generator; // 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 instantiation $generator = new Generator($options); // Package generation $generator->generatePackage();
With command line:
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.
With Docker:
Such as with the command line above, simply use the docker run
command line before:
$ docker run --rm -it --volume $PWD:/var/www mikaelcom/wsdltophp:tagname generate:package \ --urlorpath="http://developer.ebay.com/webservices/latest/ebaySvc.wsdl" \ --destination="/var/www/MySdk" \ --composer-name="myproject/mysdk" \ --force
In order to see all the used options, just remove the --force
argument.
Versions
4.0
First released on 03 April 2021, maintained until version 6.0 is released. Please read the UPGRADE-4.0 note in order to acknowledge the main changes.
3.0
First released on 04 May 2018, maintained until version 5.0 is released. Please read the UPGRADE-3.0 note in order to acknowledge the main changes.
NOT MAINTAINED ANYMORE: even if version 5 is not published nor is expected soon, maintaining 2 versions, especially for an old PHP version, is time consuming, sorry for the people who would be still using it which would encounter issues fixed in the latest version.
2.0
Not maintained since 03 April 2021.
First released on 29 Apr 2016, maintained until version 4.0 is released.
1.0
Not maintained anymore
Testing
# launch all tests $ phpunit # launch a testsuite: command, configuration, utils, model, container, parser, file, packagegenerator $ phpunit --testsuite=model
Testing using Docker
Thanks to the Docker image of phpfarm, tests can be run locally under any PHP version using the cli:
- php-7.4
First of all, you need to create your container which you can do using docker-compose by running the below command line from the root directory of the project:
$ docker-compose up -d --build
You then have a container named package_generator
in which you can run composer
commands and php cli
commands such as:
# install deps in container (using update ensure it does use the composer.lock file if there is any) $ docker exec -it package_generator php-7.4 /usr/bin/composer update # run tests in container $ docker exec -it package_generator php-7.4 -dmemory_limit=-1 vendor/bin/phpunit
Contributing
Please see CONTRIBUTING for details. In addition, code documentation is at doc.wsdltophp.com.
Credits
Developers who helped on this project are listed in the composer.json file as Contributor
and are:
- Gemorroj
- ceeram
- Georgiy Oganisyan
- Jan Zaeske
- Tom Mottram
- Catirau Mihail
- Alexander M. Turek
- Valérian Girard
- hordijk
- Andreas Möller
- Andreas Kintzinger
- Hendrik Luup
- Jacob Dreesen
- Clifford Vickrey
- Arnaud POINTET
- dypa
- tbreuss
- Paul Melekhov
- Alex Krátký
FAQ
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.
License
The MIT License (MIT). Please see License File for more information.