This article is the third article in the introductory teaching of Windows Azure AppFabric. We will introduce the labs environment.
The Microsoft AppFabric Team and March 11, 2010 launched the AppFabric Labs environment. The AppFabric team uses it to showcase some of the early features and get feedback from the community. Users do not have to pay for the use of the environment.
AppFabric LABS enables users to test and use experimental AppFabric techniques. We want to get feedback from users as quickly as possible for those exciting features and features. Labs environments do not support SLA protocols, but you can get a preview of the new features of AppFabric and help us improve these features.
Although similar to the Community Marvell Preview, LABS technology is far from commercial.
In this version of the labs environment, we offer 2 major features.
1. Silverlight Support: Increases the ability of Silverlight clients to invoke service bus and Access control services across domains.
2. Multicast with message buffers: Adds the ability to buffers to be attached to a multicast group. Information sent to a multicast group is posted to all message Buffer attached to it.
In the previous article, we demonstrated the ECHO program, but its configuration is based on an azure billing account, and this article describes how to change the Echo program to run in a labs environment.
Preconditions
For the following tutorials to work smoothly, make sure that the software or components below are installed:
· Microsoft. NET Framework 3.5 SP1
· Microsoft Visual Studio 2008 SP1 (or adjective)
· AppFabric SDK
· Windows Azure Platform Training kit-december Update (sample code)
Please make sure you have some WCF programming experience, if not, please browse here for a quick preliminary understanding of WCF.
To create the labs project and service namespaces:
1. At https://portal.appfabriclabs.com/Place, log in with your Live ID.
2. Click on the red box below to create a new AppFabric project. (You can refer to the first article in this tutorial: Create AppFabric Projects and namespaces)
3. Enter the project name, after creating the project, click to enter the project page. Click the Add service Namespace, as shown in the red box below.
4. Enter the service Namespace, click Create to wait for its activation.
5. After activation, click into the Service namespace page. The following figure
Configuration changes:
1. If the Echo program is not completed according to the previous tutorial, it can be done from the Windows Azure Platform training kit-december Update (sample code) installation directory Windowsazureplatformkit\labs \introservicebus\source\ex01-basicsample\end\cs Find the full Echo program code. Double-click BasicSample.sln to open the project.
2. Download from here to ServiceBus.config.txt. Rename the file to Servicebus.config. and place it in the following directory:
C:\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG (x86 system)
C:\Windows\Microsoft.NET\Framework64\v2.0.50727\CONFIG (x64 system)
Authentication:
At this point, all the required changes have been completed. We did not make any changes to the code, just added a configuration file. Now we are ready to debug.
1. Right-click Service Item, Debug->start new Instance
Follow the console prompts to enter the information you have registered in the https://portal.appfabriclabs.com/premises.
Please refer to the following figure for Service Namespace domain,issuer Name and issuer key.
2. Right-click the client project, Debug->start new instance to start another debugging instance, and also enter information as prompted by the console.
The final effect is as shown:
Analysis:
In terms of programming, for this echo project, the only difference between the labs environment and the billing environment is only the placement of servicebus.config. The following are the contents of the Servicebus.config:
<?xml version= "1.0" encoding= "Utf-8"?>
<!--the root Web revisit file-->
<configuration>
<Microsoft.ServiceBus>
<relayHostName>servicebus.appfabriclabs.com</relayHostName>
<stsHostName>accesscontrol.appfabriclabs.com</stsHostName>
<acmHostName>accesscontrol.appfabriclabs.com</acmHostName>
</Microsoft.ServiceBus>
</configuration>
The code that causes the difference is the following statement:
Servicebusenvironment.createserviceuri ("SB", Servicenamespacedomain, "EchoService");
This method reads the contents of the Servicebus.config, and we see that in the labs environment, the URI of the following form is returned.
sb://xxxxxx.servicebus.appfabriclabs.com/echoservice/,
Instead of placing the servicebus.config, the following form URI is returned:
sb://xxxxxx.servicebus.windows.net/echoservice/(Azure Toll account)
This program mounts the service to the labs environment.
In addition, the procedure is not the same. So the labs environment provides a consistent programming experience for developers in a very simple way, without changing the code to experience the labs environment. If you want to switch your application to a paid account, we don't need to make too many changes.