Home » Web Services » SOAP » Bug #5929
Pass CURL parameters to WSDL
Details
| Request #5929 | Pass CURL parameters to WSDL |
|---|---|
| Submitted | 2005-11-10 19:06 UTC |
| From | martin at malditainternet dot com |
| Assigned | yunosh |
| Status | Wont fix |
| Package | SOAP |
| PHP Version | 4.4.0 |
| OS | linux |
| Roadmaps | (Not assigned) |
Comments
[2005-11-10 19:06 UTC] martin at malditainternet dot com
Description:
------------
After adding CURL support in WSDL fetching, I needed to set some CURL options, so I used the $proxyOptions parameter in the WSDL constructor.
Depends on patch in bug 5815
Test script:
---------------
--- /tmp/SOAP-0.9.1/WSDL.php 2005-11-10 15:49:22.000000000 -0300
+++ SOAP/WSDL.php 2005-11-10 15:49:25.000000000 -0300
@@ -911,6 +911,11 @@
$ch=curl_init();
curl_setopt($ch, CURLOPT_URL, $wsdl_fname);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
+ if (isset($proxy_params['curl']) && is_array($proxy_params['curl'])){
+ foreach($proxy_params['curl'] as $opc=>$value){
+ curl_setopt($ch, $opc, $value);
+ }
+ }
$file_data=curl_exec($ch);
if (!$file_data) {
return $this->_raiseSoapFault("Unable to retrieve WSDL $wsdl_fname, no http body", $wsdl_fname);
--- /tmp/SOAP-0.9.1/Client.php 2005-11-10 15:49:10.000000000 -0300
+++ SOAP/Client.php 2005-11-10 15:51:00.000000000 -0300
@@ -181,7 +181,7 @@
* @param boolean $wsdl Whether the endpoint is a WSDL file.
* @param string $portName
* @param array $proxy_params Options for the HTTP_Request class (see
- * HTTP/Request.php)
+ * HTTP/Request.php) or CURL
*/
function SOAP_Client($endpoint, $wsdl = false, $portName = false,
$proxy_params = array())
@@ -208,6 +208,14 @@
$this->_raiseSoapFault($this->_wsdl->fault);
}
}
+ /**
+ * CURL parameters get screwed by array_merge_recursive (some lines ahead in function call) because the constants values are integers and get incremented when merged with another curl parameters array (from $options in &call()), so we'll leave them available just for the WSDL class.
+ * If you need to set CURL parameters for the soap client, set them on the Call function or use
+ * setOpt()
+ */
+ if (isset($this->__proxy_params['curl'])){
+ unset($this->__proxy_params['curl']);
+ }
}
function _reset()