By default, the generated client factory provides an EventDispatchingCaller
to the generated client.
This caller makes it possible to listen for SOAP events:
\Phpro\SoapClient\Event\RequestEvent
\Phpro\SoapClient\Event\ResponseEvent
\Phpro\SoapClient\Event\FaultEvent
You can subscribe your own listeners to the configured EventDispatcher
. For example:
class ResponseFailedSubscriber implements SubscriberInterface
{
// implement interface
}
$dispatcher->addSubscriber(new ResponseFailedSubscriber());
This package ships with some default subscriber plugins: