.

Windows Communication Foundation 4 Step by Step (Step By Step (Microsoft))

作者:
John Sharp
ISBN :
9780735645561
出版日期:
2010-11-23 00:00:00
语言:
国家地区:
.
550 Windows Communication Foundation 4 Step by StepURICustomers Customers/{customerID} Orders Orders/{orderID} Orders/{orderID}/CustomerDescriptionAll customers in the AdventureWorks database . A specific customer . For example, Customers/99. All orders in the AdventureWorks database . A specific order . For example, Orders/43687. The customer that placed the specified order . For example, Orders/43687/Customer retrieves the customer that placed order 43687. The orders for a specific customer . For example, Customers/99/ Orders retrieves the list of orders placed by customer 99 .Customers/{customerID}/OrdersDepending on the volume of data in the database, the Customers and Orders URIs might identify a large number of items . Therefore, it makes sense to provide additional query parameters that a user can specify to limit the number of items returned . In the following exercises, you will implement two optional query parameters called skip and top, which a user can specify as shown in the following examples:Orderstop=10 Ordersskip=500 Ordersskip=9&top=20The purpose of the top parameter is to retrieve only the first n items, where n is the value specified for this parameter . The first example shown above fetches only the first 10 orders . The skip parameter causes the query to omit the first n items and fetch data starting at item n + 1 . The second example omits the first 500 orders and fetches the data starting with order 501 . You can combine the skip and top parameters . The third example retrieves 20 orders starting, at position 10 (it omits orders 1 through 9, and then fetches orders 10 through 29 inclusive) . Combining the parameters in this way enables a client implementation to implement a paging mechanism that retrieves data in manageable block sizes . As with a SOAP Web service, the first task in implementing a REST Web service is to define the service contract . This contract specifies the operations that the service exposes and associates these operations with the URIs that identify the various resources . Web client applications can then invoke these operations by querying these URIs .Define the ProductsSales REST Web Service Contract 1. Using Visual Studio, create a new solution by using the information in the following table:Download from Wow! eBook
本书内搜索
序号 页码 相关内容
您还未搜索