Week 5a - Windows Communication Foundation

WCF Concepts and Examples


This lecture is an introduction to Windows Communication Foundation (WCF). We discuss WCF concepts and present a few examples.

Readings and Activities for the Week:

Glossary of Terms

  1. The Syllabus describes topics to be covered, reading material for you to digest as part of each lecture, and due dates for assigned projects.
  2. Projects:

    Introductory discussion of Sample Project #3.

    Sample Project #3, Sample Project #4

    Project #3, Project #4

  3. Windows Communication Foundation Presentation:

  4. Tutuorials and Background:

  5. Code examples:

    Most of these examples are self-hosted services, e.g., run in a Windows process.

    You have to run Visual Studio as administrator to run these examples. If you don't run as administrator all the examples will abort with confusing error messages. To run "as administrator" use Windows search for Visual Studio. It will return Visual Studio app. Right-click and select run as administrator.

    Note that there is only one WCF project wizard, in Visual Studio 2015, that builds a service hosted in IIS. That doesn't do anything very interesting. Since your projects will use self-hosted services, I suggest you start with one of the examples below instead of using the wizard. By-the-way, you can take a project, like one of these, and export it as a template. That will then be available from the project selections.

    Hand Crafted WCF Services - BasicHttp, Hand Crafted WCF Services - WSHttp
    Builds services without using the WCF wizard. Both declarative and programmatic construction of channels are illustrated.

    Self-Hosted Strings Service
    Demonstrate service sending strings by value, reference, and receiving out string.

    Self Hosted File Service
    Illustrates how to send files in chunks using a WCF service.

    Timed File Streaming Service
    Illustrates how to use streaming (inherently chunks) for both text and binary files.

    WCF Message Passing Communication
    Show how to build a simple, effective message-passing system using WCF data contract.

    WCF Peer-To-Peer Communication
    This example uses both WCF and WPF to build a chat like facility.
  6. EXtensible Markup Language

    XML Presentation, ppt
    You may need to use XML in the bodies of some of your messages to convey structured information.
  7. Preparation for Synchronous Discussion:

    • Go to one of the tutorials, listed above, and look up service instancing. Be prepared to discuss how you would use remote object instancing in Project #3.
  8. Lecture Take-aways:

    The most important things we discussed are: