Changeset 21461 for branches/version-2_12-dev/data/module/SOAP/WSDL.php
- Timestamp:
- 2012/02/09 01:26:58 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_12-dev/data/module/SOAP/WSDL.php
r21318 r21461 212 212 function parseURL($wsdl_uri) 213 213 { 214 $parser = &new $this->wsdlParserClass($wsdl_uri, $this, $this->docs);214 $parser = new $this->wsdlParserClass($wsdl_uri, $this, $this->docs); 215 215 216 216 if ($parser->fault) { … … 332 332 // Message data from messages. 333 333 $inputMsg = $opData['input']['message']; 334 if (isset($opData['input']['parts']) && 335 !is_array($opData['input']['parts'])) { 336 $opData['input']['parts'] = array($opData['input']['parts'] => ''); 337 338 } 334 339 if (is_array($this->messages[$inputMsg])) { 335 340 foreach ($this->messages[$inputMsg] as $pname => $pattrs) { … … 351 356 } 352 357 $outputMsg = $opData['output']['message']; 358 if (isset($opData['output']['parts']) && 359 !is_array($opData['output']['parts'])) { 360 $opData['output']['parts'] = array($opData['output']['parts'] => ''); 361 } 353 362 if (is_array($this->messages[$outputMsg])) { 354 363 foreach ($this->messages[$outputMsg] as $pname => $pattrs) { … … 789 798 eval($proxy); 790 799 } 791 $proxy = &new $classname;800 $proxy = new $classname; 792 801 793 802 return $proxy; … … 939 948 static $trail = array(); 940 949 941 $arrayType = ereg_replace('\[\]$', '', $arrayType);950 $arrayType = preg_replace('/\[\]$/', '', $arrayType); 942 951 943 952 // Protect against circular references XXX We really need to remove … … 1157 1166 { 1158 1167 parent::SOAP_Base('WSDLPARSER'); 1159 $this->cache = &new SOAP_WSDL_Cache($wsdl->cacheUse,1168 $this->cache = new SOAP_WSDL_Cache($wsdl->cacheUse, 1160 1169 $wsdl->cacheMaxAge, 1161 1170 $wsdl->cacheDir); … … 1200 1209 // Get element prefix. 1201 1210 $qname = new QName($name); 1202 if ($qname-> ns) {1203 $ns = $qname-> ns;1211 if ($qname->prefix) { 1212 $ns = $qname->prefix; 1204 1213 if ($ns && ((!$this->tns && strcasecmp($qname->name, 'definitions') == 0) || $ns == $this->tns)) { 1205 1214 $name = $qname->name; … … 1249 1258 $qn = new QName($attrs['base']); 1250 1259 $this->wsdl->complexTypes[$this->schema][$this->currentComplexType]['type'] = $qn->name; 1251 $this->wsdl->complexTypes[$this->schema][$this->currentComplexType]['namespace'] = $qn-> ns;1260 $this->wsdl->complexTypes[$this->schema][$this->currentComplexType]['namespace'] = $qn->prefix; 1252 1261 } else { 1253 1262 $this->wsdl->complexTypes[$this->schema][$this->currentComplexType]['type'] = 'Struct'; … … 1263 1272 $qn = new QName($attrs['type']); 1264 1273 $attrs['type'] = $qn->name; 1265 if ($qn-> ns && array_key_exists($qn->ns, $this->wsdl->namespaces)) {1266 $attrs['namespace'] = $qn-> ns;1274 if ($qn->prefix && array_key_exists($qn->prefix, $this->wsdl->namespaces)) { 1275 $attrs['namespace'] = $qn->prefix; 1267 1276 } 1268 1277 } … … 1362 1371 $this->wsdl->complexTypes[$this->schema][$this->currentComplexType][$q->name] = $vq->name. $vq->arrayInfo; 1363 1372 $this->wsdl->complexTypes[$this->schema][$this->currentComplexType]['type'] = 'Array'; 1364 $this->wsdl->complexTypes[$this->schema][$this->currentComplexType]['namespace'] = $vq-> ns;1373 $this->wsdl->complexTypes[$this->schema][$this->currentComplexType]['namespace'] = $vq->prefix; 1365 1374 } else { 1366 1375 $this->wsdl->complexTypes[$this->schema][$this->currentComplexType][$q->name] = $vq->name; … … 1389 1398 if ($qn) { 1390 1399 $attrs['type'] = $qn->name; 1391 $attrs['namespace'] = $qn-> ns;1400 $attrs['namespace'] = $qn->prefix; 1392 1401 } 1393 1402 $this->wsdl->messages[$this->currentMessage][$attrs['name']] = $attrs; … … 1426 1435 $qn = new QName($attrs['message']); 1427 1436 $this->wsdl->portTypes[$this->currentPortType][$this->currentOperation][$name]['message'] = $qn->name; 1428 $this->wsdl->portTypes[$this->currentPortType][$this->currentOperation][$name]['namespace'] = $qn-> ns;1437 $this->wsdl->portTypes[$this->currentPortType][$this->currentOperation][$name]['namespace'] = $qn->prefix; 1429 1438 } 1430 1439 } … … 1440 1449 1441 1450 case 'binding': 1442 $ns = $qname-> ns ? $this->wsdl->namespaces[$qname->ns] : SCHEMA_WSDL;1451 $ns = $qname->prefix ? $this->wsdl->namespaces[$qname->prefix] : SCHEMA_WSDL; 1443 1452 switch ($ns) { 1444 1453 case SCHEMA_SOAP: … … 1627 1636 1628 1637 case 'service': 1629 $ns = $qname-> ns ? $this->wsdl->namespaces[$qname->ns] : SCHEMA_WSDL;1638 $ns = $qname->prefix ? $this->wsdl->namespaces[$qname->prefix] : SCHEMA_WSDL; 1630 1639 1631 1640 switch ($qname->name) { … … 1637 1646 $qn = new QName($attrs['binding']); 1638 1647 $this->wsdl->services[$this->currentService]['ports'][$this->currentPort]['binding'] = $qn->name; 1639 $this->wsdl->services[$this->currentService]['ports'][$this->currentPort]['namespace'] = $qn-> ns;1648 $this->wsdl->services[$this->currentService]['ports'][$this->currentPort]['namespace'] = $qn->prefix; 1640 1649 break; 1641 1650 … … 1643 1652 $this->wsdl->services[$this->currentService]['ports'][$this->currentPort]['address'] = $attrs; 1644 1653 // what TYPE of port is it? SOAP or HTTP? 1645 $ns = $qname-> ns ? $this->wsdl->namespaces[$qname->ns] : SCHEMA_WSDL;1654 $ns = $qname->prefix ? $this->wsdl->namespaces[$qname->prefix] : SCHEMA_WSDL; 1646 1655 switch ($ns) { 1647 1656 case SCHEMA_WSDL_HTTP: … … 1671 1680 switch ($qname->name) { 1672 1681 case 'import': 1673 // sect 2.1.1 wsdl:import attributes: namespace location 1674 if ((isset($attrs['location']) || isset($attrs['schemaLocation'])) && 1675 !isset($this->wsdl->imports[$attrs['namespace']])) { 1682 case 'include': 1683 // WSDL 2.1.1 wsdl:import, XML Schema 4.2.3 xsd:import, XML Schema 1684 // 4.2.1 xsd:include attributes 1685 $this->status = 'types'; 1686 if (isset($attrs['location']) || isset($attrs['schemaLocation'])) { 1676 1687 $uri = isset($attrs['location']) ? $attrs['location'] : $attrs['schemaLocation']; 1677 1688 $location = @parse_url($uri); … … 1680 1691 $uri = $this->mergeUrl($base, $uri); 1681 1692 } 1682 1683 $this->wsdl->imports[$attrs['namespace']] = $attrs; 1693 if (isset($this->wsdl->imports[$uri])) { 1694 break; 1695 } 1696 $this->wsdl->imports[$uri] = $attrs; 1697 1684 1698 $import_parser_class = get_class($this); 1685 $import_parser = &new $import_parser_class($uri, $this->wsdl, $this->docs);1699 $import_parser = new $import_parser_class($uri, $this->wsdl, $this->docs); 1686 1700 if ($import_parser->fault) { 1687 unset($this->wsdl->imports[$ attrs['namespace']]);1701 unset($this->wsdl->imports[$uri]); 1688 1702 return false; 1689 1703 } 1690 $this->currentImport = $attrs['namespace']; 1691 } 1692 // Continue on to the 'types' case - lack of break; is 1693 // intentional. 1704 } 1705 $this->status = 'types'; 1706 break; 1694 1707 1695 1708 case 'types': … … 1733 1746 // sect 2.5 wsdl:binding attributes: name type 1734 1747 // children: wsdl:operation soap:binding http:binding 1735 if ($qname-> ns && $qname->ns!= $this->tns) {1748 if ($qname->prefix && $qname->prefix != $this->tns) { 1736 1749 break; 1737 1750 } … … 1740 1753 $qn = new QName($attrs['type']); 1741 1754 $this->wsdl->bindings[$this->currentBinding]['type'] = $qn->name; 1742 $this->wsdl->bindings[$this->currentBinding]['namespace'] = $qn-> ns;1755 $this->wsdl->bindings[$this->currentBinding]['namespace'] = $qn->prefix; 1743 1756 break; 1744 1757
Note: See TracChangeset
for help on using the changeset viewer.
