Web 服務的核心是定義一種使用網絡和 XML 來進行計算機到計算機交互的機制。Web 服務的一個重要組件是使用 Web 服務描述語言(Web Services Description Language,WSDL)的正式描述。一直以來沒有一種正式的語言來描述 REpresentational State Transfer (REST) Web 服務,直到現在出現了 WSDL 2.0。本文向您介紹 REST 和 WSDL 2.0,並指導您創建 REST Web 服務的 WSDL 2.0 描述。
Web 服務 這個術語通常與使用 SOAP 和 WS* 標準(例如 WS-Addressing 和 WS-Security)的基於操作的服務相關聯。REST Web 服務 這個術語一般是指使用 HTTP 和 XML 的基於資源的 Web 服務體系結構。其中每種體系結構的 Web 服務風格各有其影響力,但是直到最近,WSDL 不再同等地支持這兩種風格。WSDL 1.1 HTTP 綁定不足以描述使用 HTTP 和 XML 的通信,因此沒有辦法使用 WSDL 來正式地描述 REST Web 服務。WSDL 2.0 在設計時考慮到了 REST Web 服務,將 WSDL 2.0 作爲 World Wide Web Consortium (W3C) 建議標準來發布意味着現在有了用於描述 REST Web 服務的語言。
REST 是一種體系結構風格,它將 Web 服務視爲以資源爲中心的應用程序。實際上,這意味着 RESTful 應用程序中的每個 URL 表示一個資源。URL 還易於理解和記憶。例如,某個書店可能爲其銷售的圖書列表定義 URL http://www.bookstore.com/books/,並對 ISBN 爲 0321396855 的特定圖書的相關詳細信息定義了 URL http://www.bookstore.com/books/0321396855/。這與以操作爲中心的應用程序形成鮮明對比,後者通常具有很長的加密 URL,用於描述要執行的特定操作,例如 http://www.bookstore.com/action/query?t=b&id=11117645532&qp=0321396855。查詢參數用於篩選結果。使用同樣的書店示例,指定主題參數可以將圖書列表限制到關於某個特定主題的圖書。例如,URL http://www.bookstore.com/books/?subject=computers/eclipse 將返回關於 Eclipse 平臺的圖書列表。
Roy Fielding 博士在他的博士論文中提出了術語 REST,他在其中提到了“作爲應用程序狀態引擎的超媒體”。這意味着資源預期將包含超鏈接。這些超鏈接是用以進行轉換的方法,該轉換或者改變資源狀態,或者轉移到另一個資源。雖然超鏈接在由人類使用的 (X)HTML 應用程序中司空見慣,但它們通常不出現在由計算機使用的 XML 中。與 (X)HTML 一樣,REST Web 服務在 XML 中利用了超鏈接。
傳統 Web 應用程序使用 HTTP GET 或 POST 操作來訪問資源。相反,RESTful 應用程序全面使用了 HTTP 謂詞(POST、GET、PUT 和 DELETE),按照創建、讀取、更新和刪除 (CRUD) 模式來訪問資源。
REST 應用程序存在一個更重要的組件:RESTful 應用程序應該是無狀態的。這意味着在 REST 應用程序中,服務器上沒有存儲任何會話狀態。滿足請求所需要的所有信息都攜帶在請求消息本身之中。因此在服務顯式地允許的情況下,客戶端可以緩存資源的表示形式,從而顯著改進應用程序的性能。要了解有關 REST 的更多信息,請參閱本文結尾的參考資料部分。
|
WSDL 描述包含 Web 服務的所有詳細信息,包括:
- 服務的 URL。
- 服務所理解的通信機制。
- 服務所能執行的操作。
- 服務消息的結構。
客戶端可以使用這些詳細信息來與服務進行交互。
毫無疑問,REST Web 服務到目前爲止還沒有利用 WSDL 1.1 HTTP 綁定的一個重要原因是由於 WSDL 1.1 HTTP 綁定不足以描述 REST Web 服務。
WSDL 2.0 於 2007 年 6 月被宣佈爲 W3C 建議標準。創建 WSDL 的這第二個版本是爲了解決 WSDL 1.1 存在的問題,Web 服務互操作性(Web Services Interoperability,WS-I)組織已確定了其中的許多問題。此外,WSDL 2.0 還具有對 HTTP 綁定的良好支持。
WSDL 是一種正式地描述 Web 服務的 XML 語言。可以將 Web 服務的 WSDL 描述看作是其與客戶端之間簽署的的 API 契約。WSDL 描述指定 Web 服務的地址、允許的通信機制、接口和消息類型。簡而言之,WSDL 描述爲客戶端提供了使用 Web 服務所需要的所有信息。
WSDL 的可用性不只是用作 API 契約。作爲正式的定義,WSDL 可由 Web 服務工具用於執行操作,例如:
- 採用各種語言生成客戶端和服務存根。
- 發佈 Web 服務。
- 動態測試 Web 服務。
絕大多數 Web 服務工具都包括對 WSDL 1.1 的支持,並且對 WSDL 2.0 的支持也正在增加。Apache Web 服務項目包含兩個目前支持 WSDL 2.0 的子項目。Woden 是一個基於 Java™ 的 WSDL 2.0 驗證分析器。該項目還包含 XSL Transformation (XSLT) WSDL 2.0 優質打印機,用於提供更加可讀的 WSDL 文檔形式。同樣來自於 Apache 的 Axis2 是一個流行的 Web 服務運行時引擎,能夠在 WSDL 2.0 文檔的基礎上生成 Java 客戶端和服務器存根。
|
本文的其餘部分將指導您完成所需的步驟,以使用下面的簡單示例場景來爲一個 REST Web 服務創建 WSDL 2.0 描述。
您將運作一傢俱有創造性 URL 的書店:http://www.bookstore.com。您先前已經創建了兩個 REST Web 服務:
- 圖書列表服務 檢索您的書店中銷售的圖書的列表。
- 圖書詳細信息服務檢索有關某一本特定圖書的詳細信息。
信息在 XML 文檔中返回。請考慮一下有關那些服務的詳細信息:
圖書列表服務的 URL 爲 http://www.bookstore.com/books/。因爲您是一家歷史悠久的圖書零售商,所以您銷售的圖書的列表相當大。因此您提供了以下查詢參數列表,客戶可以使用這些參數來篩選結果:
- Author
- Language
- Publisher
- Subject
- Title
例如,URL http://www.bookstore.com/books/?subject=computers/eclipse 返回有關 Eclipse 的計算機圖書的列表,如清單 1 所示。
<booklist:bookList xmlns:booklist="http://www.bookstore.org/booklist/xsd" xmlns:book="http://www.bookstore.org/book/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.bookstore.org/booklist/xsd booklist.xsd http://www.bookstore.org/book/xsd book.xsd"> <booklist:book url="http://www.bookstore.com/books/0321442598" title="BIRT: A Field Guide to Reporting"/> <booklist:book url="http://www.bookstore.com/books/0321205758" title="Contributing to Eclipse: Principles, Patterns, and Plug-Ins"/> <booklist:book url="http://www.bookstore.com/books/0321245873" title="Eclipse AspectJ: Aspect-Oriented Programming with AspectJ and the..."/> <booklist:book url="http://www.bookstore.com/books/0321288157" title="Eclipse Distilled"/> <booklist:book url="http://www.bookstore.com/books/0131425420" title="Eclipse Modeling Framework"/> <booklist:book url="http://www.bookstore.com/books/0321334612" title="Eclipse Rich Client Platform: Designing, Coding, and Packaging Java..."/> <booklist:book url="http://www.bookstore.com/books/0321396855" title="Eclipse Web Tools Platform: Developing Java Web Applications"/> <booklist:book url="http://www.bookstore.com/books/032142672X" title="Eclipse: Building Commercial-Quality Plug-Ins (2nd Edition)"/> <booklist:book url="http://www.bookstore.com/books/0321443853" title="Integrating and Extending BIRT"/> <booklist:book url="http://www.bookstore.com/books/0321268385" title="Official Eclipse 3.0 FAQs"/> <booklist:book url="http://www.bookstore.com/books/0321256638" title="Official Eclipse 3.0 FAQs"/> </booklist:bookList> |
圖書詳細信息服務的 URL 爲 http://www.bookstore.com/books/ISBN_NUMBER,其中 ISBN_NUMBER 應該替換爲特定圖書的 ISBN。例如,URL http://www.bookstore.com/books/0321396855 將返回我的圖書 Eclipse Web Tools Platform 的詳細信息,如清單 2 所示(請參閱參考資料以獲得指向該圖書網站的鏈接)。
<book:book xmlns:book="http://www.bookstore.org/book/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.bookstore.org/book/xsd book.xsd"> <book:title>Eclipse Web Tools Platform: Developing Java Web Applications</book:title> <book:author> <book:firstName>Naci</book:firstName> <book:lastName>Dai</book:lastName> </book:author> <book:author> <book:firstName>Lawrence</book:firstName> <book:lastName>Mandel</book:lastName> </book:author> <book:author> <book:firstName>Arthur</book:firstName> <book:lastName>Ryman</book:lastName> </book:author> <book:overview> Discover Eclipse Web Tools Platform (WTP), the new end-to-end toolset for Java-based Web development. The WTP seamlessly integrates all of the tools today's Java Web developer needs. Eclipse WTP is both an unprecedented open source resource for working developers and a powerful foundation for state-of-the-art commercial products. This book offers in-depth descriptions of every tool included in WTP, introducing powerful capabilities never before available in Eclipse. The authors cover the entire Web-development process -- from defining Web application architectures and development processes through testing and beyond. And if you're seeking to extend WTP, this book provides an introduction to the platform's rich APIs. The book also </book:overview> <book:pages>752</book:pages> <book:publisher>Addison-Wesley Professional</book:publisher> <book:language>English</book:language> <book:isbn-10>0321396855</book:isbn-10> <book:isbn-13>978-0321396853</book:isbn-13> <book:price>54.99</book:price> </book:book> |
在下面的幾個部分中,您將瞭解如何使用上面列出的詳細信息來創建圖書列表服務的 WSDL 2.0 描述。圖書詳細信息服務雖然在該場景中有用,但其 WSDL 描述並沒有結構上的不同,因此本文將不介紹該服務。然而,本文結尾的下載部分提供了圖書列表和圖書詳細信息服務的 WSDL 2.0 描述以及清單 1 和清單 2 中的相同文檔。
在開始圖書列表服務的 WSDL 描述之前,讓我們首先看一下 WSDL 2.0 基礎。
WSDL 2.0 是核心命名空間爲 http://www.w3.org/ns/wsdl 的 XML 語言。WSDL 2.0 文檔的根元素是 description
元素。description
具有四個子元素,它們共同封裝了關於某個 Web 服務的所有詳細信息。
types
interface
binding
service
WSDL 2.0 文檔的框架如清單 3 所示。
<wsdl:description xmlns:wsdl="http://www.w3.org/ns/wsdl"> <wsdl:types/> <wsdl:interface/> <wsdl:binding/> <wsdl:service/> </wsdl:description> |
|
types
元素包含了描述 Web 服務消息的所有 XML 模式元素和類型定義。WSDL 2.0 對其他類型系統的使用保持開放,但實際上僅與 XML 模式一起使用。
interface
元素定義 Web 服務操作,包括特定的輸入、輸出和所傳遞的錯誤消息,以及傳遞那些錯誤消息的順序。
binding
元素定義客戶端如何與 Web 服務通信。在 REST Web 服務的情況下,一個綁定指定客戶端可以使用 HTTP 進行通信。
service
元素將 Web 服務的地址與特定的接口和綁定相關聯。
WSDL 2.0 定義了另外兩個關於 REST Web 服務的相關命名空間:
- HTTP 命名空間 http://www.w3.org/ns/wsdl/http,其中包括 HTTP 綁定元素
- WSDL 擴展命名空間 http://www.w3.org/ns/wsdl-extensions,其中包括三個屬性的定義:兩個用於將 XML 文檔中的超鏈接與 Web 服務描述相關聯,第三個用於安全地描述 Web 服務操作
下面幾個部分將更詳細地介紹本部分中討論的所有 WSDL 元素。
提醒一下,圖書列表服務的 URL 爲 http://www.bookstore.com/books/。爲了處理該服務,您將使用 WSDL service
元素,此元素至少需要一個 endpoint
子元素。endpoint
元素的 address
屬性用於指定該服務的 URL,如清單 4 所示。endpoint
元素還用於將某個綁定與具有 binding
屬性的服務關聯起來。service
元素反過來又將某個接口與具有 interface
屬性的服務關聯起來。您將在以下幾個部分中創建接口和綁定,因此現在可以將這些屬性值保留空白。
圖書列表服務的 WSDL 2.0 文檔還需要一個目標命名空間,因此定義命名空間 http://www.bookstore.org/booklist/wsdl。
<wsdl:description xmlns:wsdl="http://www.w3.org/ns/wsdl" targetNamespace="http://www.bookstore.org/booklist/wsdl" xmlns:tns="http://www.bookstore.org/booklist/wsdl"> <wsdl:service name="BookList" interface=""> <wsdl:documentation> The bookstore's book list service. </wsdl:documentation> <wsdl:endpoint name="BookListHTTPEndpoint" binding="" address="http://www.bookstore.com/books/"> </wsdl:endpoint> </wsdl:service> </wsdl:description> |
圖書列表服務的綁定定義需要指定該服務使用 HTTP 來進行通信。爲此,可以爲 binding
元素的 type
屬性指定值 http://www.w3.org/ns/wsdl/http。
該綁定還可以選擇引用某個接口。將 interface
屬性保留空白;您將在下一個部分中創建該屬性。如果某個接口與該綁定相關聯,binding
可以選擇聲明一個子 operation
元素,用於鏡像接口的 operation
元素。您需要創建一個存根 operation
元素,並在創建接口以後填充此引用。
存在四個 HTTP 通信謂詞:
- GET
- PUT
- POST
- DELETE
圖書列表服務是讀取請求,因此使用 HTTP GET 進行通信。使用 WSDL 2.0 HTTP 命名空間中的 HTTP method
屬性,在 operation
元素上設置 GET 謂詞。要使用此屬性,您首先需要在 Description 元素上聲明命名空間 http://www.w3.org/ns/wsdl/http。
清單 5 顯示了圖書列表服務的 HTTP 綁定聲明。現在既然已經聲明瞭綁定,您可以將 endpoint
元素的綁定引用更新爲引用 tns:BookListHTTPBinding
。
<wsdl:description xmlns:wsdl="http://www.w3.org/ns/wsdl" targetNamespace="http://www.bookstore.org/booklist/wsdl" xmlns:tns="http://www.bookstore.org/booklist/wsdl" xmlns:whttp="http://www.w3.org/ns/wsdl/http"> <wsdl:binding name="BookListHTTPBinding" type="http://www.w3.org/ns/wsdl/http" interface=""> <wsdl:documentation> The RESTful HTTP binding for the book list service. </wsdl:documentation> <wsdl:operation ref="" whttp:method="GET"/> </wsdl:binding> <wsdl:service name="BookList" interface=""> <wsdl:documentation> The bookstore's book list service. </wsdl:documentation> <wsdl:endpoint name="BookListHTTPEndpoint" binding="tns:BookListHTTPBinding" address="http://www.bookstore.com/books/"> </wsdl:endpoint> </wsdl:service> </wsdl:description> |
到目前爲止,您已經瞭解如何處理圖書列表 Web 服務並與之通信。接下來您將指定圖書列表服務操作,該操作描述圖書列表服務的功能。
interface
元素及其子 operation
元素用於定義服務的操作。在該圖書列表服務的情況下,您將定義單個操作 getBookList
,此操作使用圖書列表來響應請求。
下一步,指定 operation
元素的三個屬性:
- pattern:用於指定該操作的消息交換模式(message exchange pattern,MEP)。MEP 定義操作中的消息順序及其方向。在此例中,請指定值 http://www.w3.org/ns/wsdl/in-out,以指示該服務接收一個輸入消息——圖書列表請求——併發送一個輸出消息——圖書列表。爲了支持此 MEP,請指定
operation
元素的input
和output
子元素。這些元素用於引用定義消息結構的 XML 模式元素,下一部分將創建那些消息結構。 - style:用於指定有關某個操作的附加信息。請指定值 http://www.w3.org/ns/wsdl/style/iri,從而對
input
元素內容施加限制,例如要求它僅使用 XML 模式元素。 - wsdlx:safe:在 WSDL 擴展命名空間中,此屬性聲明該操作是等冪的。這種類型的操作不修改資源,因此可以調用多次並獲得相同的結果。爲了利用此元素,可以在
description
元素上聲明 WSDL 擴展命名空間 http://www.w3.org/ns/wsdl-extensions。
您可以在“WSDL 2.0 Part 2: Adjuncts”(請參閱參考資料以獲得鏈接)中找到預定義的 MEP、樣式和 safe
屬性定義。
在清單 6 中查看圖書列表服務的接口聲明。既然現在已經聲明瞭接口和操作,您可以更新 service
和 binding
元素的接口引用和綁定 operation
元素的接口操作引用。
<wsdl:description xmlns:wsdl="http://www.w3.org/ns/wsdl" targetNamespace="http://www.bookstore.org/booklist/wsdl" xmlns:tns="http://www.bookstore.org/booklist/wsdl" xmlns:whttp="http://www.w3.org/ns/wsdl/http" xmlns:wsdlx="http://www.w3.org/ns/wsdl-extensions"> <wsdl:interface name="BookListInterface"> <wsdl:operation name="getBookList" pattern="http://www.w3.org/ns/wsdl/in-out" style="http://www.w3.org/ns/wsdl/style/iri" wsdlx:safe="true"> <wsdl:documentation> This operation returns a list of books. </wsdl:documentation> <wsdl:input element=""/> <wsdl:output element=""/> </wsdl:operation> </wsdl:interface> <wsdl:binding name="BookListHTTPBinding" type="http://www.w3.org/ns/wsdl/http" interface="tns:BookListInterface"> <wsdl:documentation> The RESTful HTTP binding for the book list service. </wsdl:documentation> <wsdl:operation ref="tns:getBookList" whttp:method="GET"/> </wsdl:binding> <wsdl:service name="BookList" interface="tns:BookListInterface"> <wsdl:documentation> The bookstore's book list service. </wsdl:documentation> <wsdl:endpoint name="BookListHTTPEndpoint" binding="tns:BookListHTTPBinding" address="http://www.bookstore.com/books/"> </wsdl:endpoint> </wsdl:service> </wsdl:description> |
圖書列表 Web 服務具有兩個消息:一個輸入消息和一個輸出消息。您需要描述特定的消息結構,以便客戶端知道要向服務發送什麼消息,以及預期服務會返回什麼消息。
WSDL 2.0 支持使用多種類型系統來描述消息內容,但是目前僅使用了 XML 模式。本部分不介紹 XML 模式的詳細信息。許多應用程序中都使用了 XML 模式,例如 WSDL 1.1,並且存在許多關於它的優秀文章。本部分重點介紹如何將 XML 模式用於圖書列表 REST Web 服務,以及如何使用 WSDL 2.0 定義的附加屬性來標註模式屬性。
要爲圖書列表 REST Web 服務創建兩個消息,您需要創建兩個全局元素:
getBookList
表示輸入消息。其中包含元素序列,包括服務上允許的每個查詢參數,即作者、標題、出版商、主題和語言。getBookList
元素的內容僅限於元素,因爲您爲接口操作指定了 IRI 樣式。bookList
表示輸出消息。其中包含book
元素的序列。每個book
元素包含title
和url
屬性。title
屬性應該是不言而喻的。url
屬性是指向圖書詳細信息 REST Web 服務的鏈接,該服務返回特定圖書的詳細信息。
您的 url
屬性定義包括兩個來自 WSDL 擴展命名空間的屬性。屬性 wsdlx:interface
和 wsdlx:binding
標識該服務的特定 WSDL 2.0 接口和綁定。工具可以使用此語義信息來自動發現該服務。要利用這些屬性,可以在 schema
元素上指定 WSDL 擴展命名空間。此外,還要在 WSDL 2.0 描述中包括圖書詳細信息服務的命名空間,以引用該服務的接口和綁定。
圖書列表服務的 XML 模式如清單 7 所示。您可以在下載部分獲取圖書詳細信息服務的描述。
<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.bookstore.org/booklist/xsd" xmlns:tns="http://www.bookstore.org/booklist/xsd" xmlns:booksvc="http://www.bookstore.org/book/wsdl" xmlns:wsdlx="http://www.w3.org/ns/wsdl-extensions" elementFormDefault="qualified"> <element name="getBookList" type="tns:getBookListType"> <annotation> <documentation> The request element for the book list service. </documentation> </annotation> </element> <element name="bookList" type="tns:bookListType"> <annotation> <documentation> The response element for the book list service. </documentation> </annotation> </element> <complexType name="getBookListType"> <sequence> <element name="author" type="string" minOccurs="0" maxOccurs="unbounded"/> <element name="title" type="string" minOccurs="0" maxOccurs="1"/> <element name="publisher" type="string" minOccurs="0" maxOccurs="1"/> <element name="subject" type="string" minOccurs="0" maxOccurs="1"/> <element name="language" type="string" minOccurs="0" maxOccurs="unbounded"/> </sequence> </complexType> <complexType name="bookListType"> <sequence> <element name="book" type="tns:bookType" minOccurs="0" maxOccurs="unbounded"/> </sequence> </complexType> <complexType name="bookType"> <attribute name="title" type="string"/> <attribute name="url" type="anyURI" wsdlx:interface="booksvc:BookInterface" wsdlx:binding="booksvc:BookHTTPBinding"/> </complexType> </schema> |
要引用 XML 模式中聲明的輸入和輸出元素,您必須將該模式導入您的 WSDL 文檔。要導入某個模式,您可以在 types 部分使用 import
元素,如清單 8 所示。您還需要在接口操作的 input
和 output
元素中添加對 getBookList
和 bookList
元素的引用,並將 XML 模式(圖書列表模式)的命名空間聲明添加到 description
元素。
清單 8 顯示了圖書列表 REST Web 服務的完整 WSDL 2.0 描述。可以在下載部分中獲取此服務和圖書詳細信息 REST Web 服務的描述。
清單 8. 圖書列表 REST Web 服務的 WSDL 2.0 描述
<wsdl:description xmlns:wsdl="http://www.w3.org/ns/wsdl" targetNamespace="http://www.bookstore.org/booklist/wsdl" xmlns:tns="http://www.bookstore.org/booklist/wsdl" xmlns:whttp="http://www.w3.org/ns/wsdl/http" xmlns:wsdlx="http://www.w3.org/ns/wsdl-extensions" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msg="http://www.bookstore.org/booklist/xsd"> <wsdl:documentation> This is a WSDL 2.0 description of a sample bookstore service listing for obtaining book information. </wsdl:documentation> <wsdl:types> <xs:import namespace="http://www.bookstore.org/booklist/xsd" schemaLocation="booklist.xsd"/> </wsdl:types> <wsdl:interface name="BookListInterface"> <wsdl:operation name="getBookList" pattern="http://www.w3.org/ns/wsdl/in-out" style="http://www.w3.org/ns/wsdl/style/iri" wsdlx:safe="true"> <wsdl:documentation> This operation returns a list of books. </wsdl:documentation> <wsdl:input element="msg:getBookList"/> <wsdl:output element="msg:bookList"/> </wsdl:operation> </wsdl:interface> <wsdl:binding name="BookListHTTPBinding" type="http://www.w3.org/ns/wsdl/http" interface="tns:BookListInterface"> <wsdl:documentation> The RESTful HTTP binding for the book list service. </wsdl:documentation> <wsdl:operation ref="tns:getBookList" whttp:method="GET"/> </wsdl:binding> <wsdl:service name="BookList" interface="tns:BookListInterface"> <wsdl:documentation> The bookstore's book list service. </wsdl:documentation> <wsdl:endpoint name="BookListHTTPEndpoint" binding="tns:BookListHTTPBinding" address="http://www.bookstore.com/books/"> </wsdl:endpoint> </wsdl:service> </wsdl:description> |
|
在本文中,您瞭解了 REST 以及 WSDL 2.0 REST Web 服務如何使用 HTTP 和 XML 來進行通信。RESTful 應用程序以資源爲中心而不是以操作爲中心。以正式的方式描述 REST Web 服務的價值是使用該描述作爲客戶端與服務提供者之間的正式契約,並支持工具。WSDL 2.0 支持 REST Web 服務的描述。您逐步地完成了使用 WSDL 2.0 和 XML 模式來描述圖書列表 REST Web 服務的過程。
但願,您將使用這裏介紹的步驟來創建圖書列表服務的 WSDL 2.0 描述,從而爲您自己的 REST Web 服務創建描述。