WSDL 接口文档定义由特定 portType 定义的操作和消息的消息格式。可以生成包含所有 WSDL 元素的整体式 WSDL 文档,也可以生成单独的 WSDL 接口文档。
以下 WSDL 接口文档基于 StockQuoteService 样本。
<?xml version="1.0" encoding="UTF-8"?>
<definitions name="StockQuoteService" targetNamespace="http:///"
xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http:///"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<message name="getQuoteRequest">
<part name="symbol" type="xsd:string"/>
</message>
<message name="getQuoteResponse">
<part name="result" type="xsd:float"/>
</message>
<!-- This service interface file defines a single port --> <!-- type StockQuoteServiceJavaPortType --> <!-- with only one operation getQuote. -->
<portType name="StockQuoteService">
<!-- The operation makes use of two abstract messages
-->
<!-- getQuoteRequest and getQuoteResponse.
-->
<operation name="getQuote" parameterOrder="symbol">
<input message="tns:getQuoteRequest"
name="getQuoteRequest"/>
<output message="tns:getQuoteResponse"
name="getQuoteResponse"/>
</operation>
</portType>
</definitions>