windows communication foundation

11
Windows Communication Foundation

Upload: mahmoud-tolba

Post on 17-Jun-2015

146 views

Category:

Education


1 download

TRANSCRIPT

Page 1: Windows Communication Foundation

Windows Communication Foundation

Page 2: Windows Communication Foundation

Introduction

WCF is a programming paradigm for building network distributed services.

Is the latest framework for building SOA applications.

Is a combined features of web services, .NET remoting, MSMQ, COM+.

Page 3: Windows Communication Foundation

WCF vs. Web services

Web Service WCF service

Can be hosted in IIS Can be hosted in IIS , WAS, Windows service

One way, request-response operation types One way , request-response , duplex

System.Xml.Serialization is used for serialization

System.Runtime.Serialization is used for serialization

Can be accessed through HTTP HTTP ,TCP , MSMQ , P2P

Security Security, Reliable messaging, Transactions

Page 4: Windows Communication Foundation

WCF Architecture

Page 5: Windows Communication Foundation

Bindings

Bindings are used to specify the transport, encoding, and protocol details required for clients and services to communicate with each other.

Binding Types

1. BasicHttpBinding

2. WSHttpBinding

3. WSDualHttpBinding

4. WSFederationHttpBinding

5. NetTcpBinding

6. NetNamedPipeBinding

7. NetMsmqBinding

8. NetPeerTcpBinding

Page 6: Windows Communication Foundation

Contracts

The contract is a standard way for describing what the service does.

There four types of the contracts

1. Service Contract

2. Data Contract

3. Message Contract

4. Fault Contract

Page 7: Windows Communication Foundation

Hosting

The advantage of WCF over web services is that WCF services can be hosted in IIS, Self Hosting, Windows

activation service.

Page 8: Windows Communication Foundation

Throttling

WCF throttling provides some properties that you can use to limit how many instances or sessions are

created at the application level.

Attribute Description

maxConcurrentCallsLimits the total number of calls that can currently be in progress across all service instances. The default is 16.

maxConcurrentInstances

The number of InstanceContext objects that execute at one time across a ServiceHost. The default is Int32.MaxValue.

maxConcurrentSessions

A positive integer that limits the number of sessions a ServiceHost object can accept. The default is 10.

Page 9: Windows Communication Foundation

Operations

In WCF there are three ways for communication

1. One way

2. Request-Reply(Default)

3. Call back

One-Way

Request-Reply

Page 10: Windows Communication Foundation

Events

Events allow the client or clients to be notified about something that has occurred on the service side. An

event may result from a direct client call, or it may be the result of something the service monitors. The

service firing the event is called the publisher, and the client receiving the event is called the subscriber.

Page 11: Windows Communication Foundation

WCF Rest services

REST stands for Representational State Transfer. (It is sometimes spelled "ReST".) It relies on a stateless,

client-server, cacheable communications protocol -- and in virtually all cases, the HTTP protocol is used.

REST is an architecture style for designing networked applications. The idea is that, rather than using complex

mechanisms such as CORBA, RPC or SOAP to connect between machines, simple HTTP is used to make calls

between machines.

In many ways, the World Wide Web itself, based on HTTP, can be viewed as a REST-based architecture.

RESTful applications use HTTP requests to post data (create and/or update), read data (e.g., make queries),

and delete data. Thus, REST uses HTTP for all four CRUD (Create/Read/Update/Delete) operations.

REST is a lightweight alternative to mechanisms like RPC (Remote Procedure Calls) and Web Services (SOAP,

WSDL, et al.). Later, we will see how much more simple REST is.