Upload
mohamed-zakarya
View
350
Download
0
Embed Size (px)
Citation preview
WCF IntroductionARCOM - KSA
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
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
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
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)
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
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
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
ARCOM-KSA
9 Service Provider , Consumer
ARCOM-KSA
10
A B C
ABC’s of Life Service
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
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
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
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
ARCOM-KSA
15
IIS / Azure (ASP.NET project) Windows Services
Hosting WCF Services
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
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.
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
ARCOM-KSA
19
Thank You ..|