Complete Windows Communication Foundation (WCF)

Code: 50397
Course duration: 2 days

50397: Complete Windows Communication Foundation (WCF) (2 Days)

About this Course

Windows Communication Foundation (WCF) is an API used to build distributed applications using .NET 3.0 (and higher). WCF was designed to expose the current multitude of Windows remoting APIs (web services, MSMQ, TCP, peer-to-peer, etc) from a single unified toolkit. In this course, students will examine the overall WCF programming model, binding choices, host options, security issues and the use of declarative markup to specify the underlying infrastructure.

Audience Profile

This class is intended for experienced .NET 2.0 software developers. No knowledge of WCF is assumed.

Course Outline

Module 1: Introducing WCF

This module reviews two key aspects of many distributed systems (interfaces and XML web services), followed by an overview of Service-Oriented Architectures (SOAs). it then surveys several core distributed APIs found within the Windows OS. With this historical background in place, the remainder of this module will introduce the Windows Communication Foundation (WCF) API. It also covers the problems WCF attempts to solve, study the ABC’s (addresses, bindings, and contracts) of building a WCF application and explore some common WCF development tools.

Lessons

  • Understand the motivation behind Windows Communication Foundation (WCF).
  • Examine the WCF assemblies and core namespaces.
  • Understand the ABCs (address, bindings, contracts) of a WCF service.
  • Details of the intrinsic WCF binding types.
  • Configuring bindings via code and via .config files.
  • A first look at WCF contracts and contractural attributes.
  • Working with the WCF Test Client and WCF Configuration Editor.

Lab : Introducing WCF

  • Examine the Visual Studio WCF-centric project workspaces.
  • Build a simple WCF service.
  • Test your service using WcfTestClient.exe.
  • Run and debug your WCF service.
  • Preview the role of the WCF Configuration Editor.

After completing this module, students will be able to:

  • Use the distributed computing landscape, prior to WCF.
  • Review the role of Service-Oriented Architectures (SOAs).
  • Understand the motivation behind WCF.
  • Know the "ABCs" of building a WCF application.
  • Know how to define and implement a WCF service contract.
  • Know WCF binding options.
  • Establish the address of a WCF service.
  • Explore some common WCF development tools.

Module 2: WCF Hosts and Clients

This module covers how to build custom WCF service hosts and custom client applications. It also explains the role of Metadata Exchange (MEX) and examines various client-side proxy generation utilities.

Lessons

  • The role of System.ServiceModel.ServiceHost.
  • Building Self-Hosting Services.
  • Specifying the ABCs declaratively and in code.
  • The role of the endpoint element.
  • Configuring multiple endpoints.
  • Configuring Metadata Exchange (MEX).
  • The role of the baseAddress element.
  • Generating client proxies.
  • Hosting a WCF service within a Windows Service.
  • Hosting a WCF service within IIS.
  • Invoking WCF service methods asynchronously using delegates.

Lab : Self Hosting Service

  • Build a simple custom database.
  • Build a custom data access library.
  • Build a self-hosting console executable.
  • Author a host .config file by hand.
  • Enable MEX and expose a single WCF service from two endpoints.
  • Generate and make use of a client-side proxy.

After completing this module, students will be able to:

  • Create self-hosting WCF services using ServiceHost.
  • Declaratively define endpoints in .config files.
  • Expose multiple services from a single host.
  • Expose a single service using multiple endpoints.
  • Define endpoints programmatically.
  • Configure bindings in .config files.
  • Understand the role of Metadata Exchange (MEX).
  • Generate and make use of client side proxies.

Module 3: Production Hosts and Common Calling Patterns

This module shows how to host a WCF service using a Windows Service and IIS virtual directory. As well, it shows a number of important client/service calling patterns, including one-way method calls and asynchronous proxy calls.

Lessons

  • The role of System.ServiceModel.ServiceHost.
  • Building Self-Hosting Services.
  • Specifying the ABCs declaratively and in code.
  • The role of the endpoint element.
  • Configuring multiple endpoints.
  • Configuring Metadata Exchange (MEX).
  • The role of the baseAddress element.
  • Generating client proxies.
  • Hosting a WCF service within a Windows Service.
  • Hosting a WCF service within IIS.
  • Invoking WCF service methods asynchronously using delegates.

Lab : Production Hosts and Asynchronous Calls

  • Host a WCF service from a Windows Service.
  • Host a WCF service from a IIS virtual directory.
  • Specify the ABC’s in code.
  • Generate asynchronous proxy code.
  • Invoke methods asynchronously.

After completing this module, students will be able to:

  • Host WCF services using a Windows Service.
  • Host WCF services using IIS.
  • Define one-way calling patterns.
  • Call methods asynchronously from the client.

Module 4: WCF Contracts

This module will examine several topics related to the construction of robust WCF services. It begins by diving into some additional details regarding the construction of WCF service contracts. The [ServiceContract] and [OperationContract] attributes can be configured in a variety of manners. It also examines how to expose custom classes from your services using “data contracts”. Anytime a WCF service method returns or receives a custom class/structure, it must be expressed via a data contract. This module also covers how to deal with runtime exceptions in a WCF service, host, and client application in an agnostic manner using “fault contracts”. Finally, this module will introduce the topic of “message contracts” and review various best practices for ensuring that a production WCF service is versioned in a fitting manner.

Lessons

  • Details of the ServiceContract attribute.
  • Details of the OperationContract attribute.
  • Designing WCF data contracts.
  • The role of the DataContractSerializer.
  • Specifying order of data members.
  • The role of the KnownType attribute.
  • Complex parameters and return values.
  • Versioning WCF contracts.
  • Controlling the format of SOAP messages.
  • Mapping CLR exceptions to SOAP faults.
  • Building strongly typed SOAP faults.

Lab : Data Contracts

  • Define custom data contracts.
  • Account for runtime exceptions by returning SOAP faults.

After completing this module, students will be able to:

  • Understand further details of building WCF "service contracts".
  • Understand how to design WCF "data contracts".
  • Understand how to design WCF "fault contracts".
  • Know the topic of WCF "message contracts".
  • Know common version issues with WCF services.

Module 5: Stateful WCF Services

This module examines the various ways state ca be injected into a WCF service. Although many WCF services do not need to remember information about the caller between invocations, WCF supports this. This module also covers the different service context modes that WCF supports, which gives the ability to control the lifetime of the service in various ways.

Lessons

  • Understanding Server Instance Context Modes.
  • The ServiceBehavior attribute.
  • Configuring per session, per call and singleton server instances.
  • The role of the OperationalBehavior attribute.
  • Sequencing method operations.
  • The WS-ReliableMessaging (WS-RM) specification.
  • Configuring WS-R.

Lab : Stateful WCF Services

  • Extend AutoLotDAL.dll with new members.
  • Continue to work with WCF service interfaces, data contracts, and custom hosts.
  • Configure various host service contexts levels and view the effects.

After completing this module, students will be able to:

  • Understand how to build WCF services that maintain state.
  • Know the role of server instance context modes.
  • Know the role of method release instance modes.
  • Understand how to sequence the order of client method invocations.

Module 6: Introduction to WCF Security

This module introduces several security topics related to WCF. These topics include support for authentication, authorization, and message integrity/confidentiality.

Lessons

  • Survey the role of WCF security.
  • Examine techniques to secure data transportation.
  • Examine security techniques for TCP-based WCF services.
  • Examine security techniques for HTTP-based WCF services.

Lab : Securing TCP Services

  • Create a set of custom users and roles.
  • Control access to various WCF service methods using role-based security.
  • Make use of imperative and declarative role-based security techniques.

Lab : Securing HTTP Services

  • Generate an X509 digital certificate for testing purposes.
  • Create a custom username validation class.
  • Author a host configuration file to demand client-based credentials.
  • Build a client that presents credentials to a WCF service.

After completing this module, students will be able to:

  • Understand common WCF security scenarios.
  • Configure bindings for message/transport security.
  • Know authentication / authorization techniques for TCP-based WCF services.
  • Know authentication / authorization techniques for HTTP-based WCF services.

Additional Reading After completing this course, students will be able to:

  • Understand the WCF Programming Model.
  • Understand WCF Binding Choices.
  • Understand Data Serialization Choices.
  • Understand WCF Security Issues.

Before attending this course, students must have:

  • Experience using Visual Studio 2005 or newer.

Guaranteed to Run

2018-03-20 09:00 to 2018-03-23 17:00
Palm Beach County Florida (Instructor-Led)
2018-03-19 09:00 to 2018-03-23 17:00
Secaucus, New Jersey (Virtual Instructor-Led)
2018-03-01 09:00 to 2018-03-02 17:00
Palm Beach County Florida (Instructor-Led)

Course Reviews

No reviews found for this course.

Be the first to write a review