Wsdl.php 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670
  1. <?php
  2. /**
  3. * Zend Framework
  4. *
  5. * LICENSE
  6. *
  7. * This source file is subject to the new BSD license that is bundled
  8. * with this package in the file LICENSE.txt.
  9. * It is also available through the world-wide-web at this URL:
  10. * http://framework.zend.com/license/new-bsd
  11. * If you did not receive a copy of the license and are unable to
  12. * obtain it through the world-wide-web, please send an email
  13. * to license@zend.com so we can send you a copy immediately.
  14. *
  15. * @category Zend
  16. * @package Zend_Soap
  17. * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
  18. * @license http://framework.zend.com/license/new-bsd New BSD License
  19. * @version $Id$
  20. */
  21. /**
  22. * @see Zend_Soap_Wsdl_Strategy_Interface
  23. */
  24. #require_once "Zend/Soap/Wsdl/Strategy/Interface.php";
  25. /**
  26. * @see Zend_Soap_Wsdl_Strategy_Abstract
  27. */
  28. #require_once "Zend/Soap/Wsdl/Strategy/Abstract.php";
  29. /** @see Zend_Xml_Security */
  30. #require_once "Zend/Xml/Security.php";
  31. /**
  32. * Zend_Soap_Wsdl
  33. *
  34. * @category Zend
  35. * @package Zend_Soap
  36. */
  37. class Zend_Soap_Wsdl
  38. {
  39. /**
  40. * @var object DomDocument Instance
  41. */
  42. private $_dom;
  43. /**
  44. * @var object WSDL Root XML_Tree_Node
  45. */
  46. private $_wsdl;
  47. /**
  48. * @var string URI where the WSDL will be available
  49. */
  50. private $_uri;
  51. /**
  52. * @var DOMElement
  53. */
  54. private $_schema = null;
  55. /**
  56. * Types defined on schema
  57. *
  58. * @var array
  59. */
  60. private $_includedTypes = array();
  61. /**
  62. * Strategy for detection of complex types
  63. */
  64. protected $_strategy = null;
  65. /**
  66. * Constructor
  67. *
  68. * @param string $name Name of the Web Service being Described
  69. * @param string $uri URI where the WSDL will be available
  70. * @param boolean|string|Zend_Soap_Wsdl_Strategy_Interface $strategy
  71. */
  72. public function __construct($name, $uri, $strategy = true)
  73. {
  74. if ($uri instanceof Zend_Uri_Http) {
  75. $uri = $uri->getUri();
  76. }
  77. $this->_uri = $uri;
  78. /**
  79. * @todo change DomDocument object creation from cparsing to construxting using API
  80. * It also should authomatically escape $name and $uri values if necessary
  81. */
  82. $wsdl = "<?xml version='1.0' ?>
  83. <definitions name='$name' targetNamespace='$uri'
  84. xmlns='http://schemas.xmlsoap.org/wsdl/'
  85. xmlns:tns='$uri'
  86. xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/'
  87. xmlns:xsd='http://www.w3.org/2001/XMLSchema'
  88. xmlns:soap-enc='http://schemas.xmlsoap.org/soap/encoding/'
  89. xmlns:wsdl='http://schemas.xmlsoap.org/wsdl/'></definitions>";
  90. $this->_dom = new DOMDocument();
  91. if (!$this->_dom = Zend_Xml_Security::scan($wsdl, $this->_dom)) {
  92. #require_once 'Zend/Server/Exception.php';
  93. throw new Zend_Server_Exception('Unable to create DomDocument');
  94. }
  95. $this->_wsdl = $this->_dom->documentElement;
  96. $this->setComplexTypeStrategy($strategy);
  97. }
  98. /**
  99. * Set a new uri for this WSDL
  100. *
  101. * @param string|Zend_Uri_Http $uri
  102. * @return Zend_Server_Wsdl
  103. */
  104. public function setUri($uri)
  105. {
  106. if ($uri instanceof Zend_Uri_Http) {
  107. $uri = $uri->getUri();
  108. }
  109. $oldUri = $this->_uri;
  110. $this->_uri = $uri;
  111. if($this->_dom !== null) {
  112. // @todo: This is the worst hack ever, but its needed due to design and non BC issues of WSDL generation
  113. $xml = $this->_dom->saveXML();
  114. $xml = str_replace($oldUri, $uri, $xml);
  115. $this->_dom = new DOMDocument();
  116. $this->_dom = Zend_Xml_Security::scan($xml, $this->_dom);
  117. }
  118. return $this;
  119. }
  120. /**
  121. * Set a strategy for complex type detection and handling
  122. *
  123. * @todo Boolean is for backwards compability with extractComplexType object var. Remove it in later versions.
  124. * @param boolean|string|Zend_Soap_Wsdl_Strategy_Interface $strategy
  125. * @return Zend_Soap_Wsdl
  126. */
  127. public function setComplexTypeStrategy($strategy)
  128. {
  129. if($strategy === true) {
  130. #require_once "Zend/Soap/Wsdl/Strategy/DefaultComplexType.php";
  131. $strategy = new Zend_Soap_Wsdl_Strategy_DefaultComplexType();
  132. } else if($strategy === false) {
  133. #require_once "Zend/Soap/Wsdl/Strategy/AnyType.php";
  134. $strategy = new Zend_Soap_Wsdl_Strategy_AnyType();
  135. } else if(is_string($strategy)) {
  136. if(class_exists($strategy)) {
  137. $strategy = new $strategy();
  138. } else {
  139. #require_once "Zend/Soap/Wsdl/Exception.php";
  140. throw new Zend_Soap_Wsdl_Exception(
  141. sprintf("Strategy with name '%s does not exist.", $strategy
  142. ));
  143. }
  144. }
  145. if(!($strategy instanceof Zend_Soap_Wsdl_Strategy_Interface)) {
  146. #require_once "Zend/Soap/Wsdl/Exception.php";
  147. throw new Zend_Soap_Wsdl_Exception("Set a strategy that is not of type 'Zend_Soap_Wsdl_Strategy_Interface'");
  148. }
  149. $this->_strategy = $strategy;
  150. return $this;
  151. }
  152. /**
  153. * Get the current complex type strategy
  154. *
  155. * @return Zend_Soap_Wsdl_Strategy_Interface
  156. */
  157. public function getComplexTypeStrategy()
  158. {
  159. return $this->_strategy;
  160. }
  161. /**
  162. * Add a {@link http://www.w3.org/TR/wsdl#_messages message} element to the WSDL
  163. *
  164. * @param string $name Name for the {@link http://www.w3.org/TR/wsdl#_messages message}
  165. * @param array $parts An array of {@link http://www.w3.org/TR/wsdl#_message parts}
  166. * The array is constructed like: 'name of part' => 'part xml schema data type'
  167. * or 'name of part' => array('type' => 'part xml schema type')
  168. * or 'name of part' => array('element' => 'part xml element name')
  169. * @return object The new message's XML_Tree_Node for use in {@link function addDocumentation}
  170. */
  171. public function addMessage($name, $parts)
  172. {
  173. $message = $this->_dom->createElement('message');
  174. $message->setAttribute('name', $name);
  175. if (sizeof($parts) > 0) {
  176. foreach ($parts as $name => $type) {
  177. $part = $this->_dom->createElement('part');
  178. $part->setAttribute('name', $name);
  179. if (is_array($type)) {
  180. foreach ($type as $key => $value) {
  181. $part->setAttribute($key, $value);
  182. }
  183. } else {
  184. $part->setAttribute('type', $type);
  185. }
  186. $message->appendChild($part);
  187. }
  188. }
  189. $this->_wsdl->appendChild($message);
  190. return $message;
  191. }
  192. /**
  193. * Add a {@link http://www.w3.org/TR/wsdl#_porttypes portType} element to the WSDL
  194. *
  195. * @param string $name portType element's name
  196. * @return object The new portType's XML_Tree_Node for use in {@link function addPortOperation} and {@link function addDocumentation}
  197. */
  198. public function addPortType($name)
  199. {
  200. $portType = $this->_dom->createElement('portType');
  201. $portType->setAttribute('name', $name);
  202. $this->_wsdl->appendChild($portType);
  203. return $portType;
  204. }
  205. /**
  206. * Add an {@link http://www.w3.org/TR/wsdl#_request-response operation} element to a portType element
  207. *
  208. * @param object $portType a portType XML_Tree_Node, from {@link function addPortType}
  209. * @param string $name Operation name
  210. * @param string $input Input Message
  211. * @param string $output Output Message
  212. * @param string $fault Fault Message
  213. * @return object The new operation's XML_Tree_Node for use in {@link function addDocumentation}
  214. */
  215. public function addPortOperation($portType, $name, $input = false, $output = false, $fault = false)
  216. {
  217. $operation = $this->_dom->createElement('operation');
  218. $operation->setAttribute('name', $name);
  219. if (is_string($input) && (strlen(trim($input)) >= 1)) {
  220. $node = $this->_dom->createElement('input');
  221. $node->setAttribute('message', $input);
  222. $operation->appendChild($node);
  223. }
  224. if (is_string($output) && (strlen(trim($output)) >= 1)) {
  225. $node= $this->_dom->createElement('output');
  226. $node->setAttribute('message', $output);
  227. $operation->appendChild($node);
  228. }
  229. if (is_string($fault) && (strlen(trim($fault)) >= 1)) {
  230. $node = $this->_dom->createElement('fault');
  231. $node->setAttribute('message', $fault);
  232. $operation->appendChild($node);
  233. }
  234. $portType->appendChild($operation);
  235. return $operation;
  236. }
  237. /**
  238. * Add a {@link http://www.w3.org/TR/wsdl#_bindings binding} element to WSDL
  239. *
  240. * @param string $name Name of the Binding
  241. * @param string $type name of the portType to bind
  242. * @return object The new binding's XML_Tree_Node for use with {@link function addBindingOperation} and {@link function addDocumentation}
  243. */
  244. public function addBinding($name, $portType)
  245. {
  246. $binding = $this->_dom->createElement('binding');
  247. $binding->setAttribute('name', $name);
  248. $binding->setAttribute('type', $portType);
  249. $this->_wsdl->appendChild($binding);
  250. return $binding;
  251. }
  252. /**
  253. * Add an operation to a binding element
  254. *
  255. * @param object $binding A binding XML_Tree_Node returned by {@link function addBinding}
  256. * @param array $input An array of attributes for the input element, allowed keys are: 'use', 'namespace', 'encodingStyle'. {@link http://www.w3.org/TR/wsdl#_soap:body More Information}
  257. * @param array $output An array of attributes for the output element, allowed keys are: 'use', 'namespace', 'encodingStyle'. {@link http://www.w3.org/TR/wsdl#_soap:body More Information}
  258. * @param array $fault An array of attributes for the fault element, allowed keys are: 'name', 'use', 'namespace', 'encodingStyle'. {@link http://www.w3.org/TR/wsdl#_soap:body More Information}
  259. * @return object The new Operation's XML_Tree_Node for use with {@link function addSoapOperation} and {@link function addDocumentation}
  260. */
  261. public function addBindingOperation($binding, $name, $input = false, $output = false, $fault = false)
  262. {
  263. $operation = $this->_dom->createElement('operation');
  264. $operation->setAttribute('name', $name);
  265. if (is_array($input)) {
  266. $node = $this->_dom->createElement('input');
  267. $soap_node = $this->_dom->createElement('soap:body');
  268. foreach ($input as $name => $value) {
  269. $soap_node->setAttribute($name, $value);
  270. }
  271. $node->appendChild($soap_node);
  272. $operation->appendChild($node);
  273. }
  274. if (is_array($output)) {
  275. $node = $this->_dom->createElement('output');
  276. $soap_node = $this->_dom->createElement('soap:body');
  277. foreach ($output as $name => $value) {
  278. $soap_node->setAttribute($name, $value);
  279. }
  280. $node->appendChild($soap_node);
  281. $operation->appendChild($node);
  282. }
  283. if (is_array($fault)) {
  284. $node = $this->_dom->createElement('fault');
  285. /**
  286. * Note. Do we really need name attribute to be also set at wsdl:fault node???
  287. * W3C standard doesn't mention it (http://www.w3.org/TR/wsdl#_soap:fault)
  288. * But some real world WSDLs use it, so it may be required for compatibility reasons.
  289. */
  290. if (isset($fault['name'])) {
  291. $node->setAttribute('name', $fault['name']);
  292. }
  293. $soap_node = $this->_dom->createElement('soap:fault');
  294. foreach ($fault as $name => $value) {
  295. $soap_node->setAttribute($name, $value);
  296. }
  297. $node->appendChild($soap_node);
  298. $operation->appendChild($node);
  299. }
  300. $binding->appendChild($operation);
  301. return $operation;
  302. }
  303. /**
  304. * Add a {@link http://www.w3.org/TR/wsdl#_soap:binding SOAP binding} element to a Binding element
  305. *
  306. * @param object $binding A binding XML_Tree_Node returned by {@link function addBinding}
  307. * @param string $style binding style, possible values are "rpc" (the default) and "document"
  308. * @param string $transport Transport method (defaults to HTTP)
  309. * @return boolean
  310. */
  311. public function addSoapBinding($binding, $style = 'document', $transport = 'http://schemas.xmlsoap.org/soap/http')
  312. {
  313. $soap_binding = $this->_dom->createElement('soap:binding');
  314. $soap_binding->setAttribute('style', $style);
  315. $soap_binding->setAttribute('transport', $transport);
  316. $binding->appendChild($soap_binding);
  317. return $soap_binding;
  318. }
  319. /**
  320. * Add a {@link http://www.w3.org/TR/wsdl#_soap:operation SOAP operation} to an operation element
  321. *
  322. * @param object $operation An operation XML_Tree_Node returned by {@link function addBindingOperation}
  323. * @param string $soap_action SOAP Action
  324. * @return boolean
  325. */
  326. public function addSoapOperation($binding, $soap_action)
  327. {
  328. if ($soap_action instanceof Zend_Uri_Http) {
  329. $soap_action = $soap_action->getUri();
  330. }
  331. $soap_operation = $this->_dom->createElement('soap:operation');
  332. $soap_operation->setAttribute('soapAction', $soap_action);
  333. $binding->insertBefore($soap_operation, $binding->firstChild);
  334. return $soap_operation;
  335. }
  336. /**
  337. * Add a {@link http://www.w3.org/TR/wsdl#_services service} element to the WSDL
  338. *
  339. * @param string $name Service Name
  340. * @param string $port_name Name of the port for the service
  341. * @param string $binding Binding for the port
  342. * @param string $location SOAP Address for the service
  343. * @return object The new service's XML_Tree_Node for use with {@link function addDocumentation}
  344. */
  345. public function addService($name, $port_name, $binding, $location)
  346. {
  347. if ($location instanceof Zend_Uri_Http) {
  348. $location = $location->getUri();
  349. }
  350. $service = $this->_dom->createElement('service');
  351. $service->setAttribute('name', $name);
  352. $port = $this->_dom->createElement('port');
  353. $port->setAttribute('name', $port_name);
  354. $port->setAttribute('binding', $binding);
  355. $soap_address = $this->_dom->createElement('soap:address');
  356. $soap_address->setAttribute('location', $location);
  357. $port->appendChild($soap_address);
  358. $service->appendChild($port);
  359. $this->_wsdl->appendChild($service);
  360. return $service;
  361. }
  362. /**
  363. * Add a documentation element to any element in the WSDL.
  364. *
  365. * Note that the WSDL {@link http://www.w3.org/TR/wsdl#_documentation specification} uses 'document',
  366. * but the WSDL {@link http://schemas.xmlsoap.org/wsdl/ schema} uses 'documentation' instead.
  367. * The {@link http://www.ws-i.org/Profiles/BasicProfile-1.1-2004-08-24.html#WSDL_documentation_Element WS-I Basic Profile 1.1} recommends using 'documentation'.
  368. *
  369. * @param object $input_node An XML_Tree_Node returned by another method to add the documentation to
  370. * @param string $documentation Human readable documentation for the node
  371. * @return DOMElement The documentation element
  372. */
  373. public function addDocumentation($input_node, $documentation)
  374. {
  375. if ($input_node === $this) {
  376. $node = $this->_dom->documentElement;
  377. } else {
  378. $node = $input_node;
  379. }
  380. $doc = $this->_dom->createElement('documentation');
  381. $doc_cdata = $this->_dom->createTextNode(str_replace(array("\r\n", "\r"), "\n", $documentation));
  382. $doc->appendChild($doc_cdata);
  383. if($node->hasChildNodes()) {
  384. $node->insertBefore($doc, $node->firstChild);
  385. } else {
  386. $node->appendChild($doc);
  387. }
  388. return $doc;
  389. }
  390. /**
  391. * Add WSDL Types element
  392. *
  393. * @param object $types A DomDocument|DomNode|DomElement|DomDocumentFragment with all the XML Schema types defined in it
  394. */
  395. public function addTypes($types)
  396. {
  397. if ($types instanceof DomDocument) {
  398. $dom = $this->_dom->importNode($types->documentElement);
  399. $this->_wsdl->appendChild($types->documentElement);
  400. } elseif ($types instanceof DomNode || $types instanceof DomElement || $types instanceof DomDocumentFragment ) {
  401. $dom = $this->_dom->importNode($types);
  402. $this->_wsdl->appendChild($dom);
  403. }
  404. }
  405. /**
  406. * Add a complex type name that is part of this WSDL and can be used in signatures.
  407. *
  408. * @param string $type
  409. * @return Zend_Soap_Wsdl
  410. */
  411. public function addType($type)
  412. {
  413. if(!in_array($type, $this->_includedTypes)) {
  414. $this->_includedTypes[] = $type;
  415. }
  416. return $this;
  417. }
  418. /**
  419. * Return an array of all currently included complex types
  420. *
  421. * @return array
  422. */
  423. public function getTypes()
  424. {
  425. return $this->_includedTypes;
  426. }
  427. /**
  428. * Return the Schema node of the WSDL
  429. *
  430. * @return DOMElement
  431. */
  432. public function getSchema()
  433. {
  434. if($this->_schema == null) {
  435. $this->addSchemaTypeSection();
  436. }
  437. return $this->_schema;
  438. }
  439. /**
  440. * Return the WSDL as XML
  441. *
  442. * @return string WSDL as XML
  443. */
  444. public function toXML()
  445. {
  446. return $this->_dom->saveXML();
  447. }
  448. /**
  449. * Return DOM Document
  450. *
  451. * @return object DomDocum ent
  452. */
  453. public function toDomDocument()
  454. {
  455. return $this->_dom;
  456. }
  457. /**
  458. * Echo the WSDL as XML
  459. *
  460. * @return boolean
  461. */
  462. public function dump($filename = false)
  463. {
  464. if (!$filename) {
  465. echo $this->toXML();
  466. return true;
  467. } else {
  468. return file_put_contents($filename, $this->toXML());
  469. }
  470. }
  471. /**
  472. * Returns an XSD Type for the given PHP type
  473. *
  474. * @param string $type PHP Type to get the XSD type for
  475. * @return string
  476. */
  477. public function getType($type)
  478. {
  479. switch (strtolower($type)) {
  480. case 'string':
  481. case 'str':
  482. return 'xsd:string';
  483. case 'long':
  484. return 'xsd:long';
  485. case 'int':
  486. case 'integer':
  487. return 'xsd:int';
  488. case 'float':
  489. return 'xsd:float';
  490. case 'double':
  491. return 'xsd:double';
  492. case 'boolean':
  493. case 'bool':
  494. return 'xsd:boolean';
  495. case 'array':
  496. return 'soap-enc:Array';
  497. case 'object':
  498. return 'xsd:struct';
  499. case 'mixed':
  500. return 'xsd:anyType';
  501. case 'void':
  502. return '';
  503. default:
  504. // delegate retrieval of complex type to current strategy
  505. return $this->addComplexType($type);
  506. }
  507. }
  508. /**
  509. * This function makes sure a complex types section and schema additions are set.
  510. *
  511. * @return Zend_Soap_Wsdl
  512. */
  513. public function addSchemaTypeSection()
  514. {
  515. if ($this->_schema === null) {
  516. $this->_schema = $this->_dom->createElement('xsd:schema');
  517. $this->_schema->setAttribute('targetNamespace', $this->_uri);
  518. $types = $this->_dom->createElement('types');
  519. $types->appendChild($this->_schema);
  520. $this->_wsdl->appendChild($types);
  521. }
  522. return $this;
  523. }
  524. /**
  525. * Add a {@link http://www.w3.org/TR/wsdl#_types types} data type definition
  526. *
  527. * @param string $type Name of the class to be specified
  528. * @return string XSD Type for the given PHP type
  529. */
  530. public function addComplexType($type)
  531. {
  532. if (in_array($type, $this->getTypes())) {
  533. return "tns:$type";
  534. }
  535. $this->addSchemaTypeSection();
  536. $strategy = $this->getComplexTypeStrategy();
  537. $strategy->setContext($this);
  538. // delegates the detection of a complex type to the current strategy
  539. return $strategy->addComplexType($type);
  540. }
  541. /**
  542. * Parse an xsd:element represented as an array into a DOMElement.
  543. *
  544. * @param array $element an xsd:element represented as an array
  545. * @return DOMElement parsed element
  546. */
  547. private function _parseElement($element)
  548. {
  549. if (!is_array($element)) {
  550. #require_once "Zend/Soap/Wsdl/Exception.php";
  551. throw new Zend_Soap_Wsdl_Exception("The 'element' parameter needs to be an associative array.");
  552. }
  553. $elementXml = $this->_dom->createElement('xsd:element');
  554. foreach ($element as $key => $value) {
  555. if (in_array($key, array('sequence', 'all', 'choice'))) {
  556. if (is_array($value)) {
  557. $complexType = $this->_dom->createElement('xsd:complexType');
  558. if (count($value) > 0) {
  559. $container = $this->_dom->createElement('xsd:' . $key);
  560. foreach ($value as $subelement) {
  561. $subelementXml = $this->_parseElement($subelement);
  562. $container->appendChild($subelementXml);
  563. }
  564. $complexType->appendChild($container);
  565. }
  566. $elementXml->appendChild($complexType);
  567. }
  568. } else {
  569. $elementXml->setAttribute($key, $value);
  570. }
  571. }
  572. return $elementXml;
  573. }
  574. /**
  575. * Add an xsd:element represented as an array to the schema.
  576. *
  577. * Array keys represent attribute names and values their respective value.
  578. * The 'sequence', 'all' and 'choice' keys must have an array of elements as their value,
  579. * to add them to a nested complexType.
  580. *
  581. * Example: array( 'name' => 'MyElement',
  582. * 'sequence' => array( array('name' => 'myString', 'type' => 'string'),
  583. * array('name' => 'myInteger', 'type' => 'int') ) );
  584. * Resulting XML: <xsd:element name="MyElement"><xsd:complexType><xsd:sequence>
  585. * <xsd:element name="myString" type="string"/>
  586. * <xsd:element name="myInteger" type="int"/>
  587. * </xsd:sequence></xsd:complexType></xsd:element>
  588. *
  589. * @param array $element an xsd:element represented as an array
  590. * @return string xsd:element for the given element array
  591. */
  592. public function addElement($element)
  593. {
  594. $schema = $this->getSchema();
  595. $elementXml = $this->_parseElement($element);
  596. $schema->appendChild($elementXml);
  597. return 'tns:' . $element['name'];
  598. }
  599. }