Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 0.14.0

Request #4076 SOAP_WSDL generateProxyCode needs additional constructor
Submitted: 2005-04-06 11:24 UTC
From: lafriks at hello dot lv Assigned: chagenbu
Status: Closed Package: SOAP
PHP Version: Irrelevant OS: Irrelevant
Roadmaps: (Not assigned)    
Subscription  


 [2005-04-06 11:24 UTC] lafriks at hello dot lv
Description: ------------ It would be great that when generating proxy code using SOAP_WSDL generateProxyCode function it would generate additional constructor for generated file. So it would be posible to when programming such way to define path to web service in configuration file and it wouldn't be necesery regenerate proxy code for development and production server if thay are using same web services just on diffrent servers. Reproduce code: --------------- Example for generated file: class WebService_Test_TestSoap extends SOAP_Client { function WebService_Test_TestSoap() { $this->SOAP_Client("http://localhost/test.asmx", 0); } function WebService_Test_TestSoap($path) { $this->SOAP_Client($path, 0); } ... }

Comments

 [2005-04-06 14:12 UTC] lafriks at hello dot lv
Diff for WSDL.php file: 460,461c460,461 < " function $classname()\n{\n". < " \$this->SOAP_Client(\"$clienturl\", 0, 0, --- > " function _soap_client(\$path) {\n". > " \$this->SOAP_Client(\$path, 0, 0, 479,480c479,480 < " function $classname()\n{\n". < " \$this->SOAP_Client(\"$clienturl\", 0);\n". --- > " function _soap_client(\$path) {\n". > " \$this->SOAP_Client(\$path, 0);\n". 482a483,488 > $class .= " function $classname() {\n". > " \$this->_soap_client(\"$clienturl\");\n". > " }\n". > " function $classname(\$path) {\n". > " \$this->_soap_client(\$path);\n". > " }\n";
 [2005-04-07 08:23 UTC] lafriks at hello dot lv
First patch was not working :) This one should be working just fine ;) --- E:\Macibas\pear_soap\SOAP-0.8.1\WSDL.php Sun Aug 22 23:39:32 2004 +++ E:\Macibas\pear_soap\WSDL.php Thu Apr 07 11:20:31 2005 @@ -457,8 +457,8 @@ if (is_array($this->proxy) && count($this->proxy) > 0) { $class = "class $classname extends SOAP_Client\n{\n". - " function $classname()\n{\n". - " \$this->SOAP_Client(\"$clienturl\", 0, 0, + " function $classname(\$path=\"$clienturl\") {\n". + " \$this->SOAP_Client(\$path, 0, 0, array("; foreach($this->proxy as $key => $val) { @@ -476,8 +476,8 @@ $class = str_replace(',))', '))', $class); } else { $class = "class $classname extends SOAP_Client\n{\n". - " function $classname()\n{\n". - " \$this->SOAP_Client(\"$clienturl\", 0);\n". + " function $classname(\$path=\"$clienturl\") {\n". + " \$this->SOAP_Client(\$path, 0);\n". " }\n"; }
 [2005-04-09 03:52 UTC] chagenbu
This bug has been fixed in CVS. In case this was a documentation problem, the fix will show up at the end of next Sunday (CET) on pear.php.net. In case this was a pear.php.net website problem, the change will show up on the website in short time. Thank you for the report, and for helping us make PEAR better.