Of late I have been reading about WCF. Though I have many things to share but thought of sharing this link about how to expose the WCF Service as multiple end points i.e. suppose we wrote a WCF service to calculate home loan. The same service can be exposed as If the service is to be used by non-.NET based app then HTTP is the best option and if both service and client are in same network and both the app are .NET based tcp can be used and if both the service and client areon same machine amed pipe can be used. The question then comes do a developer have to expose multiple interface, the answer is NO. The developer have to use the configuration files to expose the service with 3 end points. This is one of the cool feature that I liked about WCF. the below link provides the similar stuff with an example
Windows Communication Foundation(WCF) that is part of .NET Framework 3.0 is in the line of Microsoft(MS) classic work of abstraction. MS have been innovator in providing abstraction over various technologies from many years. In the same tradition I do believe WCF is another achievement. Undoubtedly they understand the difficulties in any technologies being faced by technology implementors and then they use their experience to nake the technology simple by intoroducing the layer of abstraction. Let me talk about WCf in particular now
Labels: WCF
Windows Communication Foundation (WCF) application is divided two layers namely Services and Clients The WCF services can be exposed in different ways through Web, Windows Service, Self Hosting [Running Console Application]. The Endpoint [Which is having the Address, Binding, Contract(ABC)] is definded to expose service or consume it. In our sample code so far we have developed Console Based application for both Service and Client Applications; then we have deployed the serive in IIS 6.0 in Windows Server 2003 in the first set of applications. The next set of applications are Web Applications. For developing a WCF Service we have gone through steps B. Client Application Now we will discuss futher in details. We have looked that in both application, we have the one common thing, that is Endpoint includes the Service Contact, Address and Binding; only service hosting and client applications are different. The service contact is first item to be designed fo a Service. A service contract is all about: The contact is a set of specific messages organized into basic message exchange patterns (MEPs), such as request/reply, one-way, and duplex One Way - Datagram-style delivery Three Types of Contracts All the contracts are defined on .NET application as CLR types and and on the wire it represents as XML format - WSDL/XSD/SOAP. This is implemented through Attributes. Here the details for all the types Service Data Message Fault/Exception
A. Sevice Layer
Step I - Designing Contracts
Step II - Service Hosting and Selecting Bindings
Step III - Configuring for Hosting the Service
Step IV - Based on Sevice creating Proxy for invoking the Service
Request-Reply - Immediate Reply on same logical thread
Duplex - Reply later and on backchannel (callback-style)
Service Contract - Operations, Behaviors and Communication Shape
Data Contract - Defines Schema and Versioning Strategies
Message Contract - Allows defining application-specific headers and unwrapped body content
The Service and operations defines in a service through ServiceContract and OperationContract attrubutes.
Mapping: CLR types -> Web Services Description Language (WSDL)
Describes a data structure using DataContract and DataMember attributes.
Mapping: CLR types -> XML Schema Definition (XSD)
Defines the structure of the message on the wire using MessageContract, MessageHeader, MessageBody
Mapping: CLR types -> Simple Object Access Protocol (SOAP) messages.
For any CLR exceptions defined as fault contract using FaultContract attribute and the fault's CLR Type converts to SOAP faults.
Mapping: CLR types -> SOAP faults
Labels: WCF
.NET Cheat Sheets
.NET Format String Quick Reference
Visual Studio Built-in Code Snippets
ASP.NET 2.0 Page Life Cycle & Common Events
Other Cheat Sheet Links
Labels: .NET Cheat Sheets
Labels: cheat sheets