Skip to content

Latest commit

 

History

History
25 lines (17 loc) · 765 Bytes

events.md

File metadata and controls

25 lines (17 loc) · 765 Bytes

Hooking in with events

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: