protected function createWSDL_types()
    {
        /*
        <types>
            <xsd:schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:myService"/>
        </types>
        */
        $types  = $this->wsdl->createElement('types');
        $schema = $this->wsdl->createElement('xsd:schema');
        $schema->setAttribute('xmlns', self::SOAP_XML_SCHEMA_VERSION);
        $schema->setAttribute('targetNamespace', 'urn:'.$this->wsdlclassname);
        $types->appendChild($schema);

        // array
        /*
        <xsd:complexType name="ArrayOfclassC">
            <xsd:complexContent>
                <xsd:restriction base="soapenc:Array">
                    <xsd:attribute ref="soapenc:arrayType" wsdl:arrayType="typens:classC[]"/>
                </xsd:restriction>
            </xsd:complexContent>
        </xsd:complexType>
        */
        if (isset($this->wsdlStruct['array'])) {

            foreach ($this->wsdlStruct['array'] as $source => $target) {

                //<s:complexType name="ArrayOfArrayOfInt">
                //<s:sequence>
                //<s:element minOccurs="0" maxOccurs="unbounded" name="ArrayOfInt" nillable="true" type="tns:ArrayOfInt"/>
                //</s:sequence>

                $complexType    = $this->wsdl->createElement('xsd:complexType');
                $complexContent = $this->wsdl->createElement('xsd:complexContent');
                $restriction    = $this->wsdl->createElement('xsd:restriction');
                $attribute      = $this->wsdl->createElement('xsd:attribute');
                $restriction->appendChild($attribute);
                $complexContent->appendChild($restriction);
                $complexType->appendChild($complexContent);
                $schema->appendChild($complexType);

                $complexType->setAttribute('name', $source);
                $restriction->setAttribute('base', 'soapenc:Array');
                $attribute->setAttribute('ref', 'soapenc:arrayType');

                try {
                    $class = new ReflectionClass($target);
                } catch (Exception $e) {
                }

                if (in_array($target, $this->simpleTypes)) {
                    $attribute->setAttribute(
                        'wsdl:arrayType',
                        'xsd:'.$target.'[]'
                    );
                } elseif (isset($class)) {
                    $attribute->setAttribute(
                        'wsdl:arrayType',
                        'typens:'.$target.'[]'
                    );
                } else {
                    $attribute->setAttribute(
                        'wsdl:arrayType',
                        'typens:'.$target.'[]'
                    );
                }
                unset($class);

            }
        }

        // class
        /*
        <xsd:complexType name="classB">
            <xsd:all>
                <xsd:element name="classCArray" type="typens:ArrayOfclassC" />
            </xsd:all>
        </xsd:complexType>
        */
        if (isset($this->wsdlStruct['class'])) {
            foreach ($this->wsdlStruct['class'] as $className=>$classProperty) {
                $complextype = $this->wsdl->createElement('xsd:complexType');
                $complextype->setAttribute('name', $className);
                $sequence = $this->wsdl->createElement('xsd:all');
                $complextype->appendChild($sequence);
                $schema->appendChild($complextype);
                foreach ($classProperty['property'] as $cpname => $cpValue) {
                    $element = $this->wsdl->createElement('xsd:element');
                    $element->setAttribute('name', $cpname);
                    $element->setAttribute(
                        'type', (
                            in_array(
                                $cpValue['wsdltype'],
                                $this->simpleTypes
                            )
                        ? 'xsd:' : 'typens:') . $cpValue['wsdltype']
                    );
                    $sequence->appendChild($element);
                }
            }
        }
        $this->wsdl_definitions->appendChild($types);
    }