Skip to content

Commit 8485d13

Browse files
author
Gregor Becker
committed
refactor(laravel-soap-179): Update last not working middlewares
1 parent 94e7f49 commit 8485d13

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/SoapClient.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use CodeDredd\Soap\Driver\ExtSoap\ExtSoapEngineFactory;
88
use CodeDredd\Soap\Exceptions\NotFoundConfigurationException;
99
use CodeDredd\Soap\Exceptions\SoapException;
10+
use CodeDredd\Soap\Middleware\BasicAuthMiddleware;
1011
use CodeDredd\Soap\Middleware\CisDhlMiddleware;
1112
use CodeDredd\Soap\Middleware\WsseMiddleware;
1213
use GuzzleHttp\Client;
@@ -27,6 +28,7 @@
2728
use Soap\ExtSoapEngine\Transport\TraceableTransport;
2829
use Soap\ExtSoapEngine\Wsdl\PassThroughWsdlProvider;
2930
use Soap\ExtSoapEngine\Wsdl\WsdlProvider;
31+
use Soap\Psr18Transport\Middleware\RemoveEmptyNodesMiddleware;
3032
use Soap\Psr18Transport\Psr18Transport;
3133
use Soap\Psr18Transport\Wsdl\Psr18Loader;
3234
use Soap\Psr18WsseMiddleware\WsaMiddleware;
@@ -196,8 +198,10 @@ public function withBasicAuth($username, ?string $password = null)
196198
['username' => $username, 'password' => $password] = $username;
197199
}
198200

199-
$this->middlewares = array_merge_recursive($this->middlewares, [
200-
new BasicAuthMiddleware($username, $password),
201+
$this->withHeaders([
202+
'Authorization' => sprintf('Basic %s', base64_encode(
203+
sprintf('%s:%s', $username, $password)
204+
))
201205
]);
202206

203207
return $this;

0 commit comments

Comments
 (0)