Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 1.9.2
-
Fix Version/s: 1.9.5
-
Component/s: Zend_Soap_Client
-
Labels:None
Description
Method setOptions doesn't allow user_agent option.
But this is only one possibility to customize user-agent.
I don't know why it's not allowed. Probably one reason is to allow to user customize user-agent via stream_context, but it doesn't work:
example
$opts = array('http' =>
array(
'user_agent' => 'custom'
)
);
$context = stream_context_create($opts);
$client = new SoapClient($wsdl,
array(
'context_stream' => $context
//'user_agent' => 'custom'
)
);
It's probably supposed to work, but it isn't.
The only one way to customize user-agen - is to uncomment 'user_agent' option.
I've descovered only one way to do it without changes in ZF:
example
protected function _initTestSoapClient($wsdl) { $client = new Zend_Soap_Client($wsdl); $options = array_merge($client->getOptions(), array( 'user_agent' => 'custom' )); $soapClient = new Zend_Soap_Client_Common(array($client, '_doRequest'), $wsdl, $options); $client->setSoapClient($soapClient); return $client; }
It doesn't seem good, so, I believe introducing new available option in setOptions is a reasonable idea.
Issue Links
| This issue is related to: | ||||
| ZF-6954 | Zend_Soap_Client should accept 'user_agent' http header option |
|
|
|
Fixed in trunk (r18569) and in 1.9-release branch (r18570)