Re: [SOAP] No SOAPAction
| From: | Alexander Czernay | Date: | Wed, 07 May 2003 10:46:22 +0000 |
| Subject: | Re: [SOAP] No SOAPAction | ||
| References: | 1 | Groups: | php.soap |
| Request: | Send a blank email to php-soap+get-583@lists.php.net to get a copy of this message | ||
I browsed through the HTTP.php code and found
curl_setopt($ch, CURLOPT_HTTPHEADER , array('Content-Type: text/xml;charset=' . $this->encoding, 'SOAPAction: ""'));
Why is the SOAPAction set to "" here? I changed it like this:
curl_setopt($ch, CURLOPT_HTTPHEADER , array('Content-Type: text/xml;charset=' . $this->encoding, 'SOAPAction: "'.$options['soapaction'].'"'));
So the SOAPAction shows up now, but that doesn't really help, as I still can't pass the cURL parameters.
So I use var_dump, as you suggested, to figure out what's up with the $options:
array(9) {
["trace"]=>
int(1)
["curl"]=>
int(64)
["input"]=>
string(5) "parse"
["result"]=>
string(5) "parse"
["parameters"]=>
bool(false)
["soapaction"]=>
string(31) "15031973/MDServices/GetProducts"
["namespace"]=>
string(19) "15031973/MDServices"
["style"]=>
string(3) "rpc"
["use"]=>
string(7) "encoded"
}
Until now I couldn't find the line where the curl options get screewed up. Any help appriciated.
By the way, I'm using PEAR with PHP 4.2.2, set up with the package manager. I also just updated all the installed packages.
Could it be a problem with my PHP version?
Thanks,
Alexander
LIMBOURG Arnaud wrote:
Can you do a var_dump($options) in Transport/HTTP.php sendHttps method ? I'm confused by this not working. The following code works class toto {-- _________________________________ Alexander Czernay IT-Consulting & Media Development fon +49-40-41096742 fax +49-40-41096743 icq 4773650 alexander@czernay.com www.czernay.com _________________________________var $__optionCategories = array('curl');var $__options = array(); /** * Constructor * * @access protected */ function toto() { }function setOpt($category, $option, $value=NULL) { if ($value) { if (in_array($category, $this->__optionCategories)) { $this->__options[$category][$option] = $value; } } else { $this->__options[$category] = $option; } }} $toto=& new Toto(); $toto->setOpt('curl', CURLOPT_VERBOSE, 1); print_r($toto); while (list($key, $val) = each ($toto->__options['curl'])) {print("$key, $val\n");} Apparently the options get screwed up at some point, or it's something else. Arnaud. I'm just trying out the actual SOAP Client.php lib version $Id: Client.php,v 1.57 2003/04/20 23:05:28 shane Exp $. It should connect to a server through HTTPS, connect to the webservice and get the response. Problems: Trying to set cURL options. The second and third throw Warning: Cannot use a scalar value as an array in /usr/share/pear/SOAP/Client.php on line 311 Warning: Variable passed to reset() is not an array or object in /usr/share/pear/SOAP/Transport/HTTP.php on line 502 Warning: Variable passed to each() is not an array or object in /usr/share/pear/SOAP/Transport/HTTP.php on line 503$soapclient->setOpt('curl',CURLOPT_VERBOSE, 1); //$soapclient->setOpt('curl',CURLOPT_SSL_VERIFYHOST, 0); //$soapclient->setOpt('curl',CURLOPT_SSL_VERIFYPEER, 0); $soapclient->setOpt('curl',CURLOPT_USERPWD, "username:password");Trying to set the SOAPAction parameter: 1st try: $options = array('trace' => 1, 'soapaction' => 'urn:my-url','namespace' => 'urn:my-namespace'); $ret = $soapclient->call("GetProducts",$params = array(),$options); 2nd try: $ret = $soapclient->call("GetProducts",$params = array(),'my-namespace','my-url'); When watching the logs the SOAPAction header is always empty. Any hints? Thanks for your help, Alexander -- _________________________________ Alexander Czernay IT-Consulting & Media Development fon +49-40-41096742 fax +49-40-41096743 icq 4773650 alexander@czernay.com www.czernay.com _________________________________ -- PHP Soap Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php