cvs: pear /SOAP WSDL.php
| From: | Shane Caraveo | Date: | Thu, 22 Aug 2002 07:14:27 +0000 |
| Subject: | cvs: pear /SOAP WSDL.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-5877@lists.php.net to get a copy of this message | ||
shane Thu Aug 22 03:14:27 2002 EDT
Modified files:
/pear/SOAP WSDL.php
Log:
let proxy generation work with wsdls that define multiple services.
Index: pear/SOAP/WSDL.php
diff -u pear/SOAP/WSDL.php:1.25 pear/SOAP/WSDL.php:1.26
--- pear/SOAP/WSDL.php:1.25 Sun Aug 18 16:17:49 2002
+++ pear/SOAP/WSDL.php Thu Aug 22 03:14:27 2002
@@ -17,7 +17,7 @@
// | Authors: Dietrich Ayala <dietrich@ganx4.com> Original Author |
// +----------------------------------------------------------------------+
//
-// $Id: WSDL.php,v 1.25 2002/08/18 20:17:49 shane Exp $
+// $Id: WSDL.php,v 1.26 2002/08/22 07:14:27 shane Exp $
//
require_once 'SOAP/Base.php';
require_once 'SOAP/Fault.php';
@@ -38,7 +38,7 @@
* implement IDL type syntax declaration so we can generate WSDL
*
* @access public
-* @version $Id: WSDL.php,v 1.25 2002/08/18 20:17:49 shane Exp $
+* @version $Id: WSDL.php,v 1.26 2002/08/22 07:14:27 shane Exp $
* @package SOAP::Client
* @author Shane Caraveo <shane@php.net> Conversion to PEAR and updates
* @author Dietrich Ayala <dietrich@ganx4.com> Original Author
@@ -281,13 +281,18 @@
*/
function generateProxyCode($port = '')
{
+ $multiport = count($this->services[$this->service]['ports']) > 1;
if (!$port) {
reset($this->services[$this->service]['ports']);
$port = current($this->services[$this->service]['ports']);
}
// XXX currentPort is BAD
$clienturl = $port['address']['location'];
- $classname = 'WebService_'.$this->service;
+ if ($multiport || $port) {
+ $classname =
'WebService_'.$this->service.'_'.$port['name'];
+ } else {
+ $classname = 'WebService_'.$this->service;
+ }
$classname = str_replace('.','_',$classname);
if (!$this->_validateString($classname)) return NULL;
@@ -389,9 +394,28 @@
return $class;
}
+ function generateAllProxies()
+ {
+ $proxycode = '';
+ foreach (array_keys($this->services[$this->service]['ports']) as $key) {
+ $port =& $this->services[$this->service]['ports'][$key];
+ $proxycode .= $this->generateProxyCode($port);
+ }
+ return $proxycode;
+ }
+
function getProxy($port = '')
{
- $classname = 'WebService_'.$this->service;
+ $multiport = count($this->services[$this->service]['ports']) > 1;
+ if (!$port) {
+ reset($this->services[$this->service]['ports']);
+ $port = current($this->services[$this->service]['ports']);
+ }
+ if ($multiport || $port) {
+ $classname =
'WebService_'.$this->service.'_'.$port['name'];
+ } else {
+ $classname = 'WebService_'.$this->service;
+ }
$classname = str_replace('.','_',$classname);
if (!class_exists($classname)) {
$proxy = $this->generateProxyCode($port);