【发布时间】:2013-04-16 06:52:24
【问题描述】:
我使用 JAX-WS 创建了一个小型 Web 服务。 WSDL 文件有这样的 TYPES 元素。
<types>
<xsd:schema>
<xsd:import namespace="http://ws.poc.mawia/" schemaLocation="http://localhost:777/ws/hello?xsd=1"/>
</xsd:schema>
</types>
Web 服务的 URL 是 http://localhost:777/ws/hello?wsdl 而 XSD 是 http://localhost:777/ws/hello?xsd=1 。
不同位置的 XSD Schema 文件具有这样的数据类型定义。
...
...
<xs:complexType name="student">
<xs:sequence>
<xs:element name="name" type="xs:string" minOccurs="0"/>
<xs:element name="rollNo" type="xs:int"/>
</xs:sequence>
</xs:complexType>
...
...
我见过的大多数 WSDL 文件通常在 WSDL 文件中包含完整的 XSD 定义,但 JAX-WS 将其放置在不同的位置。
这是应该的吗?如何配置 JAX-WS 以将所有 XSD 定义放在一个 WSDL 文件中?
【问题讨论】:
标签: java web-services xsd wsdl jax-ws