Skip to content

Commit

Permalink
fix WSSE does not work #15; changing order, fixed providing username
Browse files Browse the repository at this point in the history
  • Loading branch information
Florian Preusner committed Aug 3, 2015
1 parent 7a89859 commit 10a7837
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions DependencyInjection/GuzzleExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,14 @@ protected function createHandler(ContainerBuilder $container, $name, array $conf

$handler = new Definition('GuzzleHttp\HandlerStack');
$handler->setFactory(['GuzzleHttp\HandlerStack', 'create']);
$handler->addMethodCall('push', [$headerExpression]);
$handler->addMethodCall('push', [$logExpression]);

// WSSE
if(isset($config['plugin']['wsse'])
&& $username = $config['plugin']['wsse']['username']
&& $password = $config['plugin']['wsse']['password']) {
&& $config['plugin']['wsse']['username']
&& $config['plugin']['wsse']['password']) {

$username = $config['plugin']['wsse']['username'];
$password = $config['plugin']['wsse']['password'];

$wsse = $this->createWsseMiddleware($container, $username, $password);
$wsseServiceName = sprintf('guzzle_bundle.middleware.wsse.%s', $name);
Expand All @@ -110,6 +111,9 @@ protected function createHandler(ContainerBuilder $container, $name, array $conf
$handler->addMethodCall('push', [$wsseExpression]);
}

$handler->addMethodCall('push', [$headerExpression]);
$handler->addMethodCall('push', [$logExpression]);

return $handler;
} // end: createHandler()

Expand Down

0 comments on commit 10a7837

Please sign in to comment.