This is an example project on how to use the goetas-webservices/soap-client project.
Steps to use this demo project:
- clone this repo
- run
composer installto get the dependencies - run
vendor/bin/soap-client -vvv generate config/config.yml src/Service/Container --dest-class=Service/Container/SoapContainerto generate all the required files - run
php bin/demo.phpto see a working demo consuminghttp://www.dneonline.com/calculator.asmx?WSDLCalculator SOAP webservice - enjoy SOAP again
- bonus: notice the code and type hinting by PhpStorm on
$clientand$resultvariable :)
Here an explanation of dependencies present in composer.json
phpthis demo is tested on PHP 7.1symfony/var-dumperis optional and is used in this demo ony to color the output on the consolegoetas-webservices/soap-clientthis is the main SOAP client dependencyphp-http/guzzle6-adapteryour HTTP client implementation, any php-http client implementation works fine(I have opted for guzzle6, at the moment guzzle, curl, buzz and react clients are supported).php-http/messagePSR-7 http message factories, more info are available on docs.php-http.orgguzzlehttp/psr7, my PSR-7 message implementation choice forphp-http/messagegoetas-webservices/wsdl2php(require-dev) this is the main dev dependency, has to be used during development the generate all the necessary information (php classes, jms mappings, wsdl metadata) used in production
Currently src/* and metadata/* are included in .gitignore, I recommend to remove the from the "ignore" file
and to commit to your project the generated files by the command executed at step 3.