diff --git a/DependencyInjection/BeSimpleSoapExtension.php b/DependencyInjection/BeSimpleSoapExtension.php
index 02bb008..c462bca 100644
--- a/DependencyInjection/BeSimpleSoapExtension.php
+++ b/DependencyInjection/BeSimpleSoapExtension.php
@@ -84,19 +84,22 @@ class BeSimpleSoapExtension extends Extension
$definition->replaceArgument(0, $options['wsdl']);
- if (isset($options['cache_type'])) {
- $options['cache_type'] = $this->getCacheType($options['cache_type']);
-
- $defOptions = $container
+ $defOptions = $container
->getDefinition('besimple.soap.client')
->getArgument(1);
- $defOptions['cache_type'] = $options['cache_type'];
- $defOptions['namespace'] = $options['namespace'];
-
- $definition->replaceArgument(1, $defOptions);
+ foreach (array('cache_type', 'namespace', 'user_agent') as $key) {
+ if (isset($options[$key])) {
+ $defOptions[$key] = $options[$key];
+ }
}
+ if (isset($defOptions['cache_type'])) {
+ $$defOptions['cache_type'] = $this->getCacheType($defOptions['cache_type']);
+ }
+
+ $definition->replaceArgument(1, $defOptions);
+
if (!empty($options['classmap'])) {
$classmap = $this->createClientClassmap($client, $options['classmap'], $container);
$definition->replaceArgument(2, new Reference($classmap));
diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php
index bb8bedf..658a283 100644
--- a/DependencyInjection/Configuration.php
+++ b/DependencyInjection/Configuration.php
@@ -74,7 +74,8 @@ class Configuration
->prototype('array')
->children()
->scalarNode('wsdl')->isRequired()->end()
- ->scalarNode('namespace')->defaultNull()->end()
+ ->scalarNode('namespace')->end()
+ ->scalarNode('user_agent')->end()
->scalarNode('cache_type')
->validate()
->ifNotInArray($this->cacheTypes)
diff --git a/Resources/config/client.xml b/Resources/config/client.xml
index efc63ca..7ea688b 100644
--- a/Resources/config/client.xml
+++ b/Resources/config/client.xml
@@ -13,8 +13,6 @@
%kernel.debug%
- null
- null