Specifying the Address and Binding of WCF in ASP

. Sunday, January 8, 2012
  • Agregar a Technorati
  • Agregar a Del.icio.us
  • Agregar a DiggIt!
  • Agregar a Yahoo!
  • Agregar a Google
  • Agregar a Meneame
  • Agregar a Furl
  • Agregar a Reddit
  • Agregar a Magnolia
  • Agregar a Blinklist
  • Agregar a Blogmarks

Specifying the Address and Binding
In addition to implementing a contract, each endpoint also contains an address and a binding.
The address is essentially a URL that defines the location of the endpoint (and the service by
extension) in the network.
Bindings are a little more interesting. The endpoint binding defines what protocols, trans-
port, and encoding the endpoint will use for all its communication. You can create a custom
binding, but WCF provides several useful built-in bindings. Table 9-2 shows a partial list of these.
Although you can configure the address and binding programmatically, it’s much easier (not
to mention more flexible) to configure these in the app.configfile (or web.configfile) as we
show here:










As you can see, the element provides several attributes. With these, you can set the
address, binding, and contract type.
Remember, by definition a service can contain multiple endpoints. Here’s the configura-
tion for this scenario, where multiple endpoints are applied to one service:













0 comments: