Windows Azure AppFabric Introductory Teaching series (II): A simple service Bus example

Source: Internet
Author: User
Keywords nbsp; ensure that steps
Tags access access control beginning code communication control different echo

This is the second article in the introductory teaching of Windows Azure AppFabric, which can be said to be a formal beginning to learn appfabric. For subsequent learning to proceed smoothly make sure that you have browsed through the first article of this tutorial, and that you have completed the creation of the AppFabric project and namespace in this article. As we know, APPFABIRC is made up of service bus and Access Control service. This teaching with a simple echo program to all of you briefly introduce service bus, so that we can have a preliminary understanding.

The program demonstrates that the client sends a message to the service and the service responds with the same message (Echo). Shows how service bus helps communicate with different programs in different network environments.

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

Please make sure you have some WCF programming experience, if not, please browse here for a quick preliminary understanding of WCF.

Finally, make sure that you have created a AppFabric project and a service namespace. Please refer to here.

principle:

Let's start with how the Echo program works.

Step 1,2,4,5 is to make use of Access Control Service (ACS) services in AppFabric to ensure security, which is beyond the scope of this tutorial, and we will explain the principles and application of ACS in a later tutorial.

We are primarily concerned with steps 3 and 6 through 9. Step 3 is the process of establishing a connection between the server program and the cloud. Steps 6 through 9 to invoke the service for the client.

Service bus simplifies many communication challenges by providing a common set of naming conventions for services, providing direct or indirect communication between nodes that are independent of the network topology and configuration.

Service Bus allows a WCF application to listen to a public network address even if it is behind a NAT or network firewall. This feature allows applications to communicate without regard to their network structure. Using service bus eliminates the need to write and maintain complex logic and code to communicate across different networks.

Code:

After understanding the principles of communication, let's look at how the specific code is written.

Service side:

1. To create a new project in Visual Studio 2008, make sure the. NET Framework 3.5 is selected and named after the service, and Basicsample creates the console creator for the solution name.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.