Skip to content

Latest commit

 

History

History
25 lines (18 loc) · 825 Bytes

new.md

File metadata and controls

25 lines (18 loc) · 825 Bytes

Creating your own HTTP handler

You can create your own HTTP handler by implementing the HandlerInterface

<?php

use Phpro\SoapClient\Soap\Handler\HandlerInterface;
use Phpro\SoapClient\Soap\HttpBinding\SoapRequest;
use Phpro\SoapClient\Soap\HttpBinding\SoapResponse;
use Phpro\SoapClient\Soap\HttpBinding\LastRequestInfo;

class YourHandler implements HandlerInterface
{
    // Transform a soap request into a soap response:
    public function request(SoapRequest $request): SoapResponse;
    
    // Collect the last handled request and response information:
    public function collectLastRequestInfo(): LastRequestInfo;
}

Adding additional features to your custom handler

  • Allow HTTP middlewares by implementing the Phpro\SoapClient\Middleware\MiddlewareSupportingInterface.