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>