为什么 wsdl 文件中的类型元素不需要 'tns' 前缀?

why 'tns' prefix is not required in type element in wsdl files?

作为新生,我正在努力学习 wsdl。我对 XML 或与此相关的任何内容都不完全了解。我只知道基础知识。我看到 wsdl 中的基本类型通常是 xml 模式,因此使用 xsd:string 等。

我的问题是:

在 WSDL 类型元素中,tns 前缀没有像用于操作元素那样使用。为什么?

我附上了教程网站的摘录。

<xs:schema
    xmlns:xs=        "http://www.w3.org/2001/XMLSchema"
    targetNamespace= "http://jenkov.com/MyService/schema"
    xmlns:tns=       "http://jenkov.com/MyService/schema">

    <xs:element name="latestTutorialRequest" type="typeLatestTutorialRequest"/>
    <xs:complexType name="typeLatestTutorialRequest">
      <xs:sequence>
        <xs:element  name="date"   type="xs:date"/>
      </xs:sequence>
    </xs:complexType>
    <xs:element name="latestTutorialResponse" type="xs:string"/>
    <xs:element name="invalidDateError" type="xs:string"/>
</xs:schema>

该不会吧..

<xs:schema
    xmlns:xs=        "http://www.w3.org/2001/XMLSchema"
    targetNamespace= "http://jenkov.com/MyService/schema"
    xmlns:tns=       "http://jenkov.com/MyService/schema">

    <xs:element name="latestTutorialRequest" type="**tns:typeLatestTutorialRequest**"/>
    <xs:complexType name="typeLatestTutorialRequest">
      <xs:sequence>
        <xs:element name="date" type="xs:date"/>
      </xs:sequence>
    </xs:complexType>
    <xs:element name="latestTutorialResponse" type="xs:string"/>
    <xs:element name="invalidDateError" type="xs:string"/>
</xs:schema>

我同意,所写的架构是错误的。这是撒克逊人对此的评价:

Saxon-EE 9.8.0.6J from Saxonica
Java version 1.8.0_121
Using license serial number V005192
Loading schema document file:/Users/mike/Desktop/temp/test.xsd
Error at xs:element on line 6 column 80 of test.xsd:
  Cannot reference schema components in the null namespace as it has not been imported
Schema processing failed: One error was found while processing the schema