我正在努力学习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>
答案 0 :(得分:0)
我同意,所写的架构是错误的。这就是撒克逊人所说的:
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