What Are the ABCs of WCF?

Tags: WCF, Interview Questions, ASP.NET

I was asked this question at a job interview recently.  ABCs?  Huh?  I was slightly confused.  Well... I said there's the endpoints and bindings.  And of course the contracts.  But that's not ABC...  Turns out i was close enough but sort of wrong.

The endpoint encompasses the ABC.

A is for the ADDRESS .  Its WHERE you access the service.  Ex Http://MyWcf.com:8000

B is the Binding.  Its HOW you access the service.  Is it http, MSMQ, TCP? The binding also determises the security

C is the CONTRACT.  Its WHAT you pass to the service.  Its the methods you can call on the service, SERVICE CONTRACTS, and data the service expects, DATA CONTRACTS

Here's an example WCF service config from Microsoft with the ABC:

<service name="HelloWorld, IndigoConfig, Version=, Culture=neutral, PublicKeyToken=null">
binding="basicHttpBinding"       contract="HelloWorld, IndigoConfig, Version=, Culture=neutral, PublicKeyToken=null"       />   </endpoint> </service> <bindings>     <basicHttpBinding          receiveTimeout="00:00:01"     /> </bindings>

1 Comment

Add a Comment