11.07.2015 Views

y - Net Developer

y - Net Developer

y - Net Developer

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

amrameshreddy.blog.comIntroducing the Programming ApproachThe programming model of WCF, and the programming models of the other frameworks thatare part of the .NET Framework 3.0 in general, allows you to program in a few ways. In otherwords, you can accomplish your goals using any of the following approaches:• You can use the object model programmatically.• You can use configuration files.• You can use declarative programming (attributes).You will use all these approaches in most of your applications, and it is a great benefit fordevelopers to be able to choose their preference. (That is, it is important to be able to makeyour application configurable for operations people, so you will not hard-code the URLs ofyour endpoints by using the object model.) The object model is the richest model in whichyou can basically accomplish everything you like. The WCF configuration model is built ontop of the object model.For now, it is good to remember you have three options and that you have to make sureyou know the order of precedence in WCF (since you can override one model with the other).The order in which settings are applied is as follows:1. Attributes are applied.2. The configuration is applied.3. The code runs.In the following sections, we will show how to accomplish the same goals in differentways. We’ll first cover what the “ABCs” of WCF are all about.Learning the ABCs of WCFWhat are the ABCs of WCF? This is a common question that is asked of WCF lovers. In short,ABC stands for address, binding, and contract:• The address specifies where the messages can be sent (or where the service lives).• The binding describes how to send the messages.• The contract describes what the messages should contain.CHAPTER 3 ■ EXPLORING THE WCF PROGRAMMING MODEL 53Obviously, clients need to know the ABCs of a service to be able to use the service. Anendpoint acts as a “gateway” to the outside world. Usually you can refer to these three items asthe endpoint of a service defined in WCF. The Web Services Description Language (WSDL) ismeant to describe service endpoints in a standardized way. A WSDL file describes what a servicecan do, how a service can be accessed, and where the service can be found.Figure 3-1 illustrates all the components to consume WCF services using the programmingmodel and to use and extend the messaging layer. In addition, you can see how the servicemodel influences the messaging layer and which terms fit where. In this chapter, we’ll concentrateon addresses, bindings, factories, listeners, channels, and messages on the messaging layer.ramrameshreddyramrameshreddy

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!