<element>
元素是WSDL 2.0文档的顶级元素。 <types>
元素用作容器,以包含来自另一种语言的元素,以定义用于描述Web服务操作的输入/输出消息的数据类型和数据元素。以包含来自另一种语言的元素,以定义用于描述Web服务操作的输入/输出消息的数据类型和数据元素。 <types>
的语法非常简单:
<wsdl:types>
... extensibility elements from other language...
</wsdl:types>
以下是<types>
元素的示例:
<wsdl:types>
<xsd:schema xmlns:xsd=http://www.w3.org/2001/XMLSchema
targetNamespace=http://www.jb51.cc/Service/>
<xsd:element name=Hello type=xsd:string/>
<xsd:element name=HelloResponse type=xsd:string/>
</xsd:schema>
</wsdl:types>
在这个示例代码中,
- XML Schema语言用于提供可扩展性元素。
targetNamespace=http://www.jb51.cc/Service/
指示数据类型和数据元素在WSDL文档的目标名称空间中可用。- 定义了两个数据元素
HelloRequest
和HelloResponse
。 - 没有定义数据类型。