barm / soap-bundle
Symfony wrapper for SoapClient
Installs: 20
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 5
Type:symfony-bundle
Requires
- php: ^7.1.3
- ext-soap: *
- symfony/config: ^4.1
- symfony/dependency-injection: ^4.1
- symfony/http-kernel: ^4.1
Requires (Dev)
- phpunit/phpunit: ^7
This package is auto-updated.
Last update: 2025-03-27 03:54:05 UTC
README
SoapBundle provides functionality for PHP SoapClient to be traceable by Symfony WebProfiler. Compatible with Symfony 4+.
Features
- Requests are being logged in WebProfiler
- Event is being dispatched after SoapRequest
Installation
-
Add this bundle to your project as composer dependency
composer require barm/soap-bundle
-
Add this bundle in application kernel
// app/AppKernel.php public function registerBundles() { // ... $bundles[] = new Barm\Bundle\SoapBundle\BarmSoapBundle(); return $bundles; }
Usage
Instead of creating SoapClient like new \SoapClient($wsdl, $optionalOptions)
you SHOULD create it via $container->get('barm_soap.factory')->create($wsdl, $optionalOptions)
which returns an instance of SoapClient.
// Old way $oldSoapClient = new \SoapClient($wsdl); // New way $client = $container->get('barm_soap.factory')->create($wsdl);
# Old Way services: old_soap_client: class: SoapClient arguments: ["%wsdl_url%"] # New Way services: new_soap_client: class: SoapClient factory: ["@barm_soap.factory", create] arguments: ["%wsdl_url%"]
License
SoapBundle is licensed under the MIT License - see the LICENSE
file for details