【发布时间】:2016-06-07 13:16:43
【问题描述】:
我是 WSDL 的新手。我有一个关于 XML 模式命名空间的问题。
假设我在 definition 标签内定义了三个命名空间:
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:tns="urn:arjun/ws/prime/primeservice/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:Query="urn:/arjun/xml/prime/primeservice/query"
xmlns:Data="urn:/arjun/xml/prime/primeservice/data"
targetNamespace="urn:arjun/ws/prime/primeservice/" >
当我在其中一个命名空间中定义类型时,如果我需要对该命名空间的引用,是否需要导入其他命名空间(如下例所示)
<types>
<xsd:schema targetNamespace="urn:arjun/ws/prime/primeservice/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
attributeFormDefault="unqualified"
elementFormDefault="qualified">
<xsd:import namespace="urn:/arjun/xml/prime/primeservice/query"/>
<xsd:element name="Input" type="tns:Input"/>
<xsd:complexType name="Input">
<xsd:sequence>
<xsd:element ref="Query:StanderedInput"/>
</xsd:sequence>
</xsd:complexType>
...
</xsd:schema
</types>
或者我可以直接引用它而不导入该命名空间?
【问题讨论】:
标签: xsd namespaces wsdl wsimport