15. Overview of WCF

About this Tutorial

Objectives

Delegates will learn to develop applications using C# 4.5. After completing this course, delegates will be able to:

  • Use Visual Studio 2012 effectively
  • Create commercial C# Web Applications
  • Develop multi-threaded applications, Use WCF and LINQ

Audience

This course has been designed primarily for programmers new to the .Net development platform. Delegates experience solely in Windows application development or earlier versions of C# will also find the content beneficial.

Prerequisites

No previous experience in C# programming is required. But any experience you do have in programming will help. Also no experience in Visual Studio is required. But again any experience you do have with programming development environments will be a valuable.

Download Solutions

HTML tutorial


Overview

  1. What is a Service?
    • A service provides a specific function – Typically a business function, such as processing a purchase order.
    • A service can provide a single discrete function – E.g. converting one type of currency into another.
    • Or it can perform a set of related business functions – E.g. handling the various operations in an airline reservations system.
  2. What is WCF?
    • WCF is Microsoft’s unified API for creating service-oriented applications:
      • WCF provides a run-time environment for services.
      • Enables you to expose and consume CLR types as services.
    • WCF implements industry standards, to promote interoperability between services:
      • Service interactions.
      • Type conversions.
      • Marshalling.
      • Protocol support.
  3. WCF Versions:
    • WCF 3.* (in .NET Framework 3.*):
      • Hosting services.
      • Service instance management.
      • Asynchronous calls.
      • Reliability.
      • Transaction management.
      • Disconnected queued calls.
      • Security.
    • WCF 4.* (in .NET Framework 4.*):
      • Simplified configuration
      • Discovery.
      • Routing service.
      • REST (representational state transfer) improvements.
      • Windows Workflow services.
  4. Endpoints: A, B, C – A locatable service is known as an “endpoint”:
    • Address – Where to find a service (i.e. a URL).
    • Binding – How to communicate with a service (e.g. HTTP).
    • Contract – What the service can do (a set of operations).
    • EndpointABC

  5. A is for Address:
    • Every service is associated with a unique address – Address defines location and transport protocol (“schema”).
    • General format of addresses: – [transport] :// [machine] [:optional port] / [optional URI].
    • WCF supports the following transport schemas.
      Address
  6. B is for Binding:
    • A binding specifies low-level communication details – Transport protocol, Message encoding, Reliability etc…
    • WCF has several predefined bindings.
    • For example –
      Binding
  7. C is for Contract:
    • A contract defines the callable operations for a service:
      • [ServiceContract] – Exposes a .NET type (class or interface) as a WCF contract.
      • [OperationContract] – Exposes a method in a WCF service.
      • [DataContract] – Designates a type as being usable as a service param/return.
      • Simple example.
        [ServiceContract(Namespace="urn:myNamespace")]
        interface ITempConverter
        {
          [OperationContract]
          double CtoF(double c);
          [OperationContract]
          double FtoC(double f);
        }

Estimated Time – 1 Hour

Not what you are looking? Try the next tutorial – Multithreading and Parallelization

 

Well done. You have completed the tutorial in the C# course. The next tutorial is

16. Multithreading and Parallelization


Back to beginning
Copyright © 2016 TalkIT®






If you liked this post, please comment with your suggestions to help others.
If you would like to see more content like this in the future, please fill-in our quick survey.