You are on page 1of 32

Module 1

Service-Oriented
Architecture

Module Overview
What Is SOA?
The Benefits of SOA
Scenarios and Standards
Introduction to WCF

Lesson 1: What Is SOA?


Challenges in Building Business Applications
Objectives of Service-Oriented Architecture
What Is a Service?
The Pillars of SOA
Services Communicate Through Edges

Challenges in Building Business Applications

We are living in a distributed world

Business is agile

Efficient integration and interoperability are essential

Costs must be reduced

Systems have to be scalable, secure, and reliable

Objectives of Service-Oriented Architecture

SOA is an architectural style designed for building distributed


systems

Agility

Productivity

Reuse

Reduce Cost

What Is a Service?

A service exposes functionality by accepting


data (requests) and sometimes returning
data (responses)

The Pillars of SOA

The following properties define a service-oriented


architecture:

Services handle data, not objects

Services are autonomous

Services have explicit boundaries

Services expose contract and policy

Services Communicate Through Edges

Services expose edges to the outside worldedges can be


used for communication with the service

All interaction with a service is done through an edge

A service can expose multiple edges

The edge has an address

SOA edges are WCF endpoints

Lesson 2: The Benefits of SOA


SOA Improves Productivity
SOA Allows for Agility
SOA Reduces IT Costs
SOA Enables Many Communication Technologies
SOA Supports High Scalability
SOA Drives Interoperability Between Systems
SOA Provides Service Reliability
SOA Has Built-in Security

SOA Improves Productivity

Services are autonomous: This prevents spaghetti code

Services are interoperable: Use your favorite technology for


service development

Major development environments (including Microsoft Visual


Studio 2010) embrace SOA

Service autonomy enables easy testability

SOA Allows for Agility

The client depends on the contract onlythe service


implementation is free to change

Services can movea broker or a service repository provides


the right address when required

Clients can dynamically change the service to consume

Service instances can be created and destroyed dynamically


according to load

Advanced integration can be achieved by processing messages


(e.g. using Microsoft BizTalk)

SOA Reduces IT Costs

You can reuse a business module across domains

You can outsource capabilities

Service autonomy provides simplicity

Infrastructure and business capabilities can be consumed from


general service publishers

SOA Enables Many Communication Technologies

Different edges might use different connectivity technologies

Various messaging patterns may be used

Each edge might use a different security policy

Edges might be load-balanced

Edge technology = WCF binding and behaviors

SOA Supports High Scalability

Multiple instances of the service may be used

Services can be arranged in various topologies to improve


scalability

Fire-and-forget (one-way messages) is a scalable pattern

Messages can be load-balanced

Messages can be persisted

SOA Drives Interoperability Between Systems

Services deal with data

The service expects to get data in a certain format

The service does not know what technology was used on the
client side to produce the data

Messages can be transformed to overcome versioning and


interoperability issues

WS-* standards provide consistency across technologies

SOA Provides Service Reliability

Backup services can be used when original services fail

Retry policies can eventually ensure success

Message persistence enables retries

Monitoring and runtime management improves reliability

SOA Has Built-in Security

Data is a valuable asset that must be protected

Services exchange data

Various security layers are used to protect data

Authentication and authorization is implemented using


information sent within protected tokens (data)

Application security best practices should be implemented

Lesson 3: Scenarios and Standards


Applications Exposed as Web Services
Intranet Applications as Services
Web 2.0 Applications in the Browser
Services Use SOAP
Web Services Use Representational State Transfer
WS-* Standards Integrate Web Services

Applications Exposed as Web Services

Business model: Export your capabilities across the web

Intranet Applications as Services

Business model: Reuse capabilities across the enterprise

Application

Web 2.0 Applications in the Browser

Business model: Consume web services from your browser

Web
Application

Services Use SOAP

SOAP is an XML-based standard

SOAP carries messages for Web servicesmessages are


created according to the service contract

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header>
<To s:mustUnderstand="1"
xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none">http://
127.0.0.1:8080/CalcService</To>
<Action s:mustUnderstand="1"
xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none">Add</
Action>
</s:Header>
<s:Body>
<Add xmlns="Fabrikam.com">
<a>2</a>
<b>3</b>
</Add>
</s:Body>
</s:Envelope>

Web Services Use Representational State Transfer

REST is an architectural style for services

REST utilizes the HTTP protocol

Contract is based on HTTP verbs, input data is written in URIs

Simpler interoperability and versioning

Various standardized encodings

WS-* Standards Integrate Web Services

WS-* is a group of XML-based standards relevant for Web


services

WS-* defines how security, transaction, addressing, and


reliability information is transmitted

WS-* forms the basis for Web service interoperability

SOAP
WS-Addressing
WS-Security
WS-Trust
WS-Coordination

WS-Discovery
WS-Reliable Messaging
WSDL
WS-Federation
WS-Policy

Lesson 4: Introduction to WCF


What Is WCF?
WCF Objectives for Service Implementation
The WCF Communication Model

What Is WCF?

WCF is a unified .NET framework for building service-oriented


applications

WCF was introduced in .NET Framework 3.0 and extended


in .NET 3.5 and .NET 4

WCF is the foundation for other Microsoft-distributed


technologies

WCF Objectives for Service Implementation

Service development should be simple but still extensible to


meet a variety of needs

One API should be used for all communication protocols

Services should be interoperable

Services should use WS-* standards if applicable

Services can support SOAP, REST, and other communication


architectures

The WCF Communication Model

WCF is designed to make communication simple, but allow


extensibility when appropriate

Services communicate using messages that are exchanged


between endpoints: Address, Binding, Contract combinations

Service

Client
A

Message
C

A
Address

Binding

Contract

(Where)

(How)

(What)

Lab: Service-Oriented Architecture


Exercise 1: Practicing the SOA Tenets
Exercise 2: Implementing Service Agility and Scalability
Exercise 3: Interoperating with Other SOA Technologies
Exercise 4: Using REST Services

Logon information

Virtual machine

10263A-SVR1

User name

Administrator

Password

Pa$$w0rd

Estimated time: 60 minutes

Lab Scenario

Lab Review
What are the advantages of creating autonomous services?
What is the meaning of the SOA principle explicit

boundaries?

Give one example of SOA agility


How can you call a REST service?

Module Review and Takeaways


Review Questions
Tools