tailieunhanh - Introducing Windows Azure- P39

Introducing Windows Azure- P39: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 6 AZURE .NET SERVICES SERVICE BUS 3. Create a service host class. The format to compose an address of .NET Service Bus is the following where optional required. sb http https solution . service topic sub topic The endpoint address to be used in this exercise is sb Pheonix RelayService 4. Listing 6-3 shows the implementation for the host class. This class declares two constructors. The second constructor takes the endpoint URI as a parameter. This allows the host to be able to accept different endpoints in order to support multiple modes for the .NET relay connection. As you can see we use a username and password to authenticate in this example. The class constructor of the service host accepts four parameters that will be passed in when the host instance is instantiated. The first parameter is a generic type parameter of the WCF service implementation class not the service contract interface type and the other three parameters are account-related parameters solutionName password and topic. The topic parameter is used to construct the URI address as a lower-level hierarchy in case there are multiple service hosts registered under the same solution and we can get all URI addresses that are globally unique. The remaining part of the host implementation is pretty straightforward. We use the URI address to instantiate a ChannelFactory instance the ChannelFactory class can accept the WCF interface type IRelayPublishEventService which is derived from both the custom-defined WCF service interface and the IClientChannel interface defined from the namespace . We then call the CreateChannel and Open methods sequentially to start the service request listener on the host side from the cloud. Listing 6-3. Implementation ofthe Host Class using System using using using using using .

crossorigin="anonymous">
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.