tailieunhanh - Introducing Windows Azure- P33

Introducing Windows Azure- P33: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 5 AZURE .NET SERVICES ACCESS CONTROL results results return message region Console Utilities static public string ProcessPassword StringBuilder password new StringBuilder ConsoleKeyInfo info true while if if 0 - 1 1 b b else if info true Please sit back and wait for your account to be authenticated from .Net access service 0 0 . 0 return endregion 2. Define a client communication channel interface lAccountFederationClientChannel derived from the interface in order to do the duplex communication. The code is shown in Listing 5-2. This listing is for the implementation of the Main function of the host application. 133 CHAPTER 5 AZURE .NET SERVICES ACCESS CONTROL Listing 5-2. WCF Client Channel Service Contract Definition using System using using using using namespace public interface IAccountFederationClientChannel lAccountFederationService IClientChannel 3. Next we are going to build a console application to host the WCF service. As Listing 5-3 shows we need to do the following steps to the initialization on the server side. 1. Create a endpoint URI. The URI address for the .NET Access Control Service is sb services AzureForDotNetDeveloper SolutionName . 2. Define a TransportClientEndpointBehavior instance. This instance takes the user credential information. Currently the .NET Access Control Service accepts three types of credential Solution Password Windows CardSpace Information Card and Certificates. In this example we use the user name .