CodeDredd/laravel-soap

handler must be a callable

nechin opened this issue · 2 comments

I've got an exception

"[object] (CodeDredd\\Soap\\Exceptions\\SoapException(code: 0): handler must be a callable at ...\\vendor\\codedredd\\laravel-soap\\src\\Exceptions\\SoapException.php:17)
[stacktrace]
#0 ...\\vendor\\codedredd\\laravel-soap\\src\\SoapClient.php(348): CodeDredd\\Soap\\Exceptions\\SoapException::fromThrowable()
#1 ...: CodeDredd\\Soap\\SoapClient->call()
...
[previous exception] [object] (InvalidArgumentException(code: 0): handler must be a callable at ...\\vendor\\guzzlehttp\\guzzle\\src\\Client.php:68)
[stacktrace]
#0 ...\\vendor\\php-http\\guzzle6-adapter\\src\\Client.php(79): GuzzleHttp\\Client->__construct()
#1 ...\\vendor\\php-http\\guzzle6-adapter\\src\\Client.php(47): Http\\Adapter\\Guzzle6\\Client::buildClient()
#2 ...\\vendor\\codedredd\\laravel-soap\\src\\SoapClient.php(135): Http\\Adapter\\Guzzle6\\Client::createWithConfig()
#3 ...\\vendor\\codedredd\\laravel-soap\\src\\SoapClient.php(174): CodeDredd\\Soap\\SoapClient->setHandler()
#4 ...\\vendor\\codedredd\\laravel-soap\\src\\SoapClient.php(370): CodeDredd\\Soap\\SoapClient->withHandlerOptions()
#5 ...\\vendor\\codedredd\\laravel-soap\\src\\SoapClient.php(323): CodeDredd\\Soap\\SoapClient->buildClient()
#6 ...: CodeDredd\\Soap\\SoapClient->call()
...

The problem is in the constructor for the file guzzle6-adapter\Client.php. In $config variable for parameter 'handler' is passed an array, not a callable object.

An example usage is:

$context = stream_context_create([
    'ssl' => [
        'verify_peer' => false,
        'verify_peer_name' => false,
        'allow_self_signed' => true
    ]
]);
$response = Soap::baseWsdl('http://test.com'/v1?wsdl)->withWsse([
    'userTokenName' => 'username',
    'userTokenPassword' => 'password',
])->withOptions([
    'trace' => true,
    'connection_timeout' => '60',
    'stream_context' => $context,
    'cache_wsdl' => WSDL_CACHE_NONE
])->call(...);

Laravel: 7.26.1

Can you fix this?
Thanks.

stale commented

Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!

stale commented

Hey there, it's me again! I am going close this issue to help our maintainers focus on the current development roadmap instead. If the issue mentioned is still a concern, please open a new ticket and mention this old one. Cheers and thanks for using Laravel Soap!