...Technology Simplified

Monday, May 14, 2012

Understanding WCF

No comments :
WCF brings all the formerly distinct and separate Microsoft connectivity technologies together under a single umbrella within the System.ServiceModel namespace.
Web services (ASMX), the Web service Extensions (WS*), Microsoft Message Queuing (MSMQ), COM+, and .NET Remoting are included in WCF.
With WCF you won't have to choose between implementations in a variety of different namespaces and coding types to create a connected application.
Whether your application connects via loosely coupled Web services, or tightly coupled Enterprise Services, the coding model will be consistent and the transition between different communication types will be much smoother—because they will all be using the same programming namespace.
WCF follows the "software as a service" model, where all units of functionality are defined as services.
A WCF Service is exposed using End point.
WCF Service can be deployed, discovered and consumed as Endpoint
All communications with the WCF service will happen via the endpoints.
The endpoints specify a Contract that defines which methods of the Service class will be accessible via the endpoint;
each endpoint may expose a different set of methods.
The endpoints also define a binding that specifies how a client will communicate with the service and the address where the endpoint is hosted.
WCF provides Windows Activation Services which can be used to host the WCF service.
Otherwise the WCF service can also be hosted in IIS or in any process by using the Service Host class, which is provided by WCF.
Services can also be self-hosted.
An End point is based on ABC.

Address → Where Service is located.
The address specifies the location of the service which will be exposed for clients that will use it to communicate with the service.
The address's protocol that WCF can provided: HTTP , TCP ,NamedPipe , Peer2Peer ,MSMQ.
[transport]://[machine][:optional port]
http://localhost
http://localhost:8081
http://localhost:8081/Service
net.tcp://localhost:8082/Service
net.pipe://localhost/Pipe

Binding → How Service can be consumed/ used
In other words: how the two parties will communicate in terms of transport (HTTP , TCP ,NamedPipe , Peer2Peer ,MSMQ) ,encoding (text, binary etc.) and protocols (like transactional support or reliable messaging).
BasicHttpBinding
NetTcpBinding
WSHttpBinding
NetMsqmqBinding Etc..
Class Name Element Name Transport Encoding WS-* Protocols
BasicHttpBinding basicHttpBinding HTTP XML 1.0 WS-I Basic Profile 1.1
WSHttpBinding wsHttpBinding HTTP XML 1.0 Message security, reliable sessions, and transactions
WSDualHttpBinding wsDualHttpBinding HTTP XML 1.0 Message security, reliable sessions, and transactions
NetTcpBinding netTcpBinding TCP Binary Transport security, reliable sessions, and transactions
NetNamedPipeBinding netNamedPipeBinding Named Pipes Binary Transport security, reliable sessions, and transactions
NetMsmqBinding netMsmqBinding MSMQ Binary Transport security and queue transactions


Contract → What is Available (Interfaces..)
contracts available in WCF are:
Service Contract – Exposes the service.
Operation Contract- Exposes the service members.
Data Contract – Describes service parameters.
Fault Contracts – Defines error handling semantics

Hosting
WCF services must be hosted by a Windows Process (host process).
Hosting options include:
IIS 5 & 6.
IIS 7 & Windows Activation Service (WAS).
Console or Windows Forms applications (also called “Self-Hosting”)

No comments :

Post a Comment