dwendrich / expressive-soap-middleware
Middleware for handling soap webservice requests based on zend expressive 2.0.
Requires
- php: ^7.0
- zendframework/zend-expressive: ^2.0.2
- zendframework/zend-expressive-helpers: ^4.0
- zendframework/zend-servicemanager: ^3.3
- zendframework/zend-soap: ^2.6
- zendframework/zend-stdlib: ^3.1
Requires (Dev)
- filp/whoops: ^2.1.7
- phpunit/phpunit: ^6.0.8
- squizlabs/php_codesniffer: ^2.8.1
README
Middleware for handling soap webservice requests based on zend expressive 2.0.
Requirements
- PHP 7.0 or above
- zend expressive 2.0
Installation
Install the latest version with composer. For information on how to get composer or how to use it, please refer to getcomposer.org.
$ composer require dwendrich/expressive-soap-middleware
Basic usage
Webservice methods are provided by a class implementing public methods. Once you have your service class in place,
set up a route which delegates http requests to your service using GET
or POST
request methods to the
SoapController middleware:
$app->route( '/path-to-service', 'MyServiceClass\SoapController', ['GET', 'POST'], 'my_service' );
Provide soap controller configuration, to tell where to find the service class containing the webservice methods:
return [ 'soap_controller' => [ 'MyServiceClass\SoapController' => [ // provide the fully qualified class name which implements the service methods 'class' => MyServiceClass::class, // provide optional soap server options 'server_options' => [], ], ], ];
Http requests to /path-to-service
using GET
request method will now deliver a wsdl document describing your soap
service based on the public methods implemented in MyServiceClass
.
Calls to your soap service are handled via http request method POST
.