Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ
Tải xuống
Introducing Windows Azure- P46:The cloud platform is getting more and more attractive to the computing world. Today, service-oriented architecture (SOA) and aspect-oriented programming (AOP) techniques are widely used in enterprise solutions. A question an IT management team or a software development team may ask is, what is the next trend going to be? Cloud computing seems to be the right answer. | CHAPTER 7 AZURE .NET SERVICES WORKFLOWS passed into the Weblnvoke attribute Method and UriTemplate. The value for Method could be either POST or PUT. The value of POST is used for inserting or deleting data and the value of PUT is used for updating data. There are four methods defined in this interface PlaceShoppingCartItem UpdateShoppingCartItem DeleteShoppingCartItem PayShoppingCartItem Listing 7-5. WCF Service Contract Interface Definition of IShoppingCartService using System using System.Collections.Generic using System.Linq using System.Text using System.ServiceModel using System.ServiceModel.Web using ShoppingCartServiceLibrary namespace ShoopingCartWorkflows ServiceContract public interface IShoppingCartService OperationContract webInvoke Method POST UriTemplate ShoppingCartItem ShoppingCartItem PlaceShoppingCartItem ShoppingCartItem ShoppingCartItem OperationContract webInvoke Method PUT UriTemplate ShoppingCartItem id ShoppingCartItem UpdateShoppingCartItem string id ShoppingCartItem ShoppingCartItem OperationContract webInvoke Method POST UriTemplate ShoppingCartItem id ShoppingCartItem DeleteShoppingCartItem string id ShoppingCartItem ShoppingCartItem OperationContract webInvoke Method PUT UriTemplate CreditCardPayment ShoppingCartItem id void PayShoppingCartItem string id CreditCardPayment CreditCardPayment 223 CHAPTER 7 AZURE .NET SERVICES WORKFLOWS 3. Add a C library project ShoppingCartServiceLibrary to implement the IShoppingCartService service contract and data contract as shown in Listing 7-6 and Listing 7-7. Listing 7-6 is the implementation for the service interface and Listing 7-7 is the data contract used to hold the shopping card property data. Listing 7-6. WCFIShoppingCartService Service Contract Implementation using System using System.Collections.Generic using System.Linq using System.Text using System.Runtime.Serialization namespace ShoppingCartServiceLibrary Serializable DataContract Name ShoppingCartItem Namespace http costco.com .