19
WCF Introduction ARCOM - KSA

WCF Introduction

Embed Size (px)

Citation preview

Page 1: WCF Introduction

WCF IntroductionARCOM - KSA

Page 2: WCF Introduction

ARCOM-KSA

2 Agenda What is WCF From object to service SOA , ESB ASMX & WCF WCF architecture Ways of talk [Client – Service] Service Provider , Consumer ABC’s of WCF Hosting WCF Advantage , Disadvantages Demos

Page 3: WCF Introduction

ARCOM-KSA

3 What is WCF?

Stands for Windows Communication Foundation Microsoft’s unified programming model (the service model) for building

Service-Oriented [SOA] apps

Page 4: WCF Introduction

ARCOM-KSA

4 From Objects to Services

PolymorphismEncapsulationSubclassing

Message-basedSchema+ContractBinding via Policy

1980s

2000s

Interface-basedDynamic LoadingRuntime Metadata1990s

Object-Oriented

Service-Oriented

Component-Based

Page 5: WCF Introduction

ARCOM-KSA

5 What’s SOA - ESB

software architecture model used for designing and implementing the

interaction between mutually interacting software applications in  (SOA)

software design and software architecture design pattern  discrete pieces of software application functionality as services A service is a self-contained unit of functionality

SOA (service oriented architecture)

ESB (Enterprise Service Bus)

Page 6: WCF Introduction

6

ARCOM-KSA

ASMX is limiting WCF is powerful

ASMX & WCF

Xml web services HTTP-only hosting in IIS  No support for security Advanced scenarios require mixing

models

highly configurable and highly extensible

 supports what ASMX cannot supports a unified programming

model across all protocols

Page 7: WCF Introduction

Channel ModelFormats

(Atom, JSON, XML,…)

Transports(HTTP, TCP, …)

Protocols(SOAP, HTTP, Open Data Protocol,…)

Service ModelData Contract Service

ContractService Behavior

Programming ModelSOAP

ServicesWeb HTTP

ServicesData

ServicesRIA

ServicesWorkflo

w Services

WCF Architecture

ARCOM-KSA

7

Page 8: WCF Introduction

Ways to TalkOne Way

Request-Reply

Duplex (Dual)

ARCOM-KSA

8

Client Service

One Way: Datagram-style delivery

Request-Reply : Immediate Reply on same logical thread

Duplex Reply : “later” and on backchannel (callback-style)q

Page 9: WCF Introduction

ARCOM-KSA

9 Service Provider , Consumer

Page 10: WCF Introduction

ARCOM-KSA

10

A B C

ABC’s of Life Service

Page 11: WCF Introduction

ServiceClient

Address, Binding, Contract [WCF]

Address

ARCOM-KSA

11

Endpoints

ABC

Endpoints

A B C

A B CMessage

Address Where the service isBinding How to talk to the service Contract What the service can do

Page 12: WCF Introduction

ARCOM-KSA

12 ABC’s Cont. [Address] Combination of transport, server name, port & path Transport is determined by the binding Examples

http://localhost:8001net.tcp://localhost:8002/MyServicenet.pipe://localhost/MyPipenet.msmq://localhost/private/MyServicenet.msmq://localhost/MyService

A

Page 13: WCF Introduction

ARCOM-KSA

13 ABC’s Cont. [Bindings] Transport

HTTPTCPMSMQ

Message formats and encoding Plain textBinary Message Transmission Optimization Mechanism (MTOM)

Communication securityNo security Transport security Message security

B

Page 14: WCF Introduction

ABC’s Cont. [Contracts]Service Contrac

tDefines

Operations, Behaviors and Communicatio

n Shape

What does your service

do

Data Contrac

tDefines Data entities and parameter

types

What object data is used

Message

Contract

Allows defining application-

specific headers and unwrapped

body content

Allows control over the SOAP

structure of messages

Fault Contrac

t

Defines error types

ARCOM-KSA

14C

Page 15: WCF Introduction

ARCOM-KSA

15

IIS / Azure (ASP.NET project) Windows Services

Hosting WCF Services

Page 16: WCF Introduction

ARCOM-KSA

16 Demos Hello WCF Edit WCF Configuration

Add services Add end points Binding configuration

Consume WCF Service Reference Using Code First

WCF Using UML [Class Diagram] WCF Architecture Code

Service Service.Contracts Service.Business

Page 17: WCF Introduction

ARCOM-KSA

17Advantage

You can create new components for security, transport, authentication.

No much change in code for implementing the security model ,, Small changes in the configuration will make your requirements.

Its faster than ASMX

Its Interoperability, for java, and more.

WCF is interoperable with other services

WCF services provide better reliability and security.

Page 18: WCF Introduction

ARCOM-KSA

18 Disadvantage WCF is Microsoft's implementation of SOA its APIs are solely controlled by MS

which makes interoperability a bit difficult.

deploy WCF apps, need more underlying hardware

Page 19: WCF Introduction

ARCOM-KSA

19

Thank You ..|