/** * Add a WSDL Complex Type to the Document * * Creates a Complex Type with it's Sequence and Elements * * @param WsdlType $wsdlType The Type to Add * @return void */ private function addType(WsdlType &$wsdlType) { $wsdlSequence = $this->createElement("sequence"); // Create WSDL Elements $elements = $wsdlType->getElements(); foreach ($elements as &$element) { $wsdlElement = $this->createElement("element"); $wsdlElement->setAttribute("name", $element->name); if (WsdlType::isPrimitiveType($element->type)) { $wsdlElement->setAttribute("type", "xsd:" . $element->type); } else { $wsdlElement->setAttribute("type", "tns:" . $element->type); } // Add WSDL Element to the Sequence $wsdlSequence->appendChild($wsdlElement); } // Create the WSDL Complex Type $complexType = $this->createElement("complexType"); $complexType->setAttribute("name", $wsdlType->getName()); $complexType->appendChild($wsdlSequence); $wsdlSchema = $this->getSchema(); $wsdlSchema->appendChild($complexType); }