Nati Dobkin

Slides:



Advertisements
Similar presentations
Indigo Jonathan Turnbull Nick Cartwright Ivan Konontsev Chris Bright.
Advertisements

WCF Intro Scott Reed Owner - Brain Hz Software Instructor – DevelopMentor
1 Windows Communication Foundation Adapters in BizTalk Server 2006 R2 Ulrich Roxburgh Services2 Ltd. SOA307.
Zoiner Tejada Hershey Technologies. About Zoiner Tejada.
 Introduction  WCF Definition  WCF Architecture  Implementation  WCF Demo Overview.
1 Nordjyllands Erhvervakademi Windows Communication Foundation Introduction –.Net foundations –Communication Protocols –SOA tenets WCF –Basics –Contracts.
Windows Communication Foundation and Web Services.
70-290: MCSE Guide to Managing a Microsoft Windows Server 2003 Environment Chapter 5: Managing File Access.
The Microsoft Technical Roadshow 2006 Windows Communication Foundation Mike Taulty Developer & Platform Group Microsoft Ltd
Hands-On Microsoft Windows Server 2003 Administration Chapter 5 Administering File Resources.
Hands-On Microsoft Windows Server 2003 Administration Chapter 3 Administering Active Directory.
ASP.NET Programming with C# and SQL Server First Edition
Jon Flanders INT303. About Me  Jon Flanders –  Independent consultant/trainer  BizTalk MVP.
Module 13: WCF Receive Adapters. Overview Lesson 1: Introduction to WCF Receive Adapters Lesson 2: Configuring a WCF Receive Adapter Lesson 3: Using the.
Getting Started with Windows Communication Foundation 4.5 Ed Jones, MCT, MCPD, MCTS Consultant RBA Inc.
Getting Started with WCF Windows Communication Foundation 4.0 Development Chapter 1.
Christian Weyer thinktecture.
Copyright ©2004 Virtusa Corporation | CONFIDENTIAL Introduction to Windows Communication Foundation Ruwan Wijesinghe.
Stephen Kaufman Delivery Architect Microsoft Consulting Services Session Code: INT401 Paolo Salvatori Principal Program Manager BizTalk Customer Advisory.
Overview of Previous Lesson(s) Over View  ASP.NET Pages  Modular in nature and divided into the core sections  Page directives  Code Section  Page.
Agenda What Is the Windows Communication Foundation? How Does It Work? How Do I Use and Deploy It? Bindings Addresses Contracts How to host WCF services.
70-290: MCSE Guide to Managing a Microsoft Windows Server 2003 Environment, Enhanced Chapter 5: Managing File Access.
Module 14: WCF Send Adapters. Overview Lesson 1: Introduction to WCF Send Adapters Lesson 2: Consuming a Web Service Lesson 3: Consuming Services from.
1 Windows Communication Foundation: Integrating COM+ and MSMQ Applications Andy Milligan COM305 Program Manager Microsoft Corporation.
Microsoft Visual Studio 2010 Muhammad Zubair MS (FAST-NU) Experience: 5+ Years Contact:- Cell#:
1 Stateful Session Beans Stateless Session Beans Michael Brockway Sajjad Shami Northumbria University School of Computing, Engineering & Information Sciences.
1 UCN 2012 Why use distributed (client / server) applications? To connect tiers within the same application... –client & server is both.NET assemblies.
Microsoft Visual Studio 2010 Muhammad Zubair MS (FAST-NU) Experience: 5+ Years Contact:- Cell#:
Intro to WCF From the beginning and uses Steve AppRochester.
Random Logic l Forum.NET l Web Services Enhancements for Microsoft.NET (WSE) Forum.NET ● October 4th, 2006.
A Deep Dive into Best Practices with the Windows Communication Foundation John Justice COM415 Program Manager Microsoft Corporation.
10 – 12 APRIL 2005 Riyadh, Saudi Arabia. Visual Studio 2005 : New Features for the Web Services Developer Malek Kemmou CEO Arrabeta Consulting Microsoft.
Mahesh Krishnan, Senior Consultant, Readify Slide 1.
Collaborate Lesson 4C / Slide 1 of 22 Collaborate Knowledge Byte In this section, you will learn about: The EJB timer service Message linking in EJB 2.1.
Telerik Software Academy Web Services & Cloud.
2 Productive Windows Communication Foundation Jeremy Boyd Mindscape MSDN Regional Director – New Zealand SOA315.
Kemal Baykal Rasim Ismayilov
ASP.NET Web Services.  A unit of managed code installed under IIS that can be remotely invoked using HTTP.
Windows Communication Foundation (“Indigo”): Writing Reliable and Transacted Distributed Applications Shy “BAD-P” Cohen COM307 Program Manager Connected.
Presentation 24: Windows Communication Foundation Introduced Objektorienteret Netværkskommunikation.
Agenda What Is the Windows Communication Foundation? How Does It Work? How Do I Use and Deploy It? Bindings Addresses Contracts How to host WCF services.
IT533 Lectures ASP.NET AJAX.
Component Patterns – Architecture and Applications with EJB copyright © 2001, MATHEMA AG Component Patterns Architecture and Applications with EJB Markus.
Chapter 9 Transactions and Reliable Sessions MS 304 WXMLA 1  WCF Transactions  Reliable Messaging Sessions.
.NET Mobile Application Development XML Web Services.
Remote Method Invocation A Client Server Approach.
Dhananjay Kumar MVP-Connected System 1. WCF  Agenda What is WCF ? Why WCF? Address, Binding, Contract End Points Hosting Message Patterns Programming.
Christian Weyer thinktecture.
Introduction to.NET FX 3.0 (+ sneak preview of.NET FX 3.5) Martin Parry Developer & Platform Group Microsoft Ltd
Windows Communication Foundation António Cruz Freelancer (SAPO/PT.COM)
Integrating and Extending Workflow 8 AA301 Carl Sykes Ed Heaney.
Shani Raba Team Leader & Software Architect
Windows Communication Foundation Stipe Ivan Latković.
O VERVIEW OF SOA AND WCF Jinaldesai.net – My Thouths And Learnings.
Windows Communication Foundation. Agenda How We Got Here ASMX vs WCF Throwdown WCF Contracts Service Data Message Bindings Security Reliability Declarative.
Windows Communication Foundation and Web Services
Windows Communication Foundation
Segments Introduction: slides 2–7 10 minutes
Windows Communication Foundation
Windows Communication Foundation
Window Communication Foundation
WCF.
Windows Communication Foundation
Windows Communication Foundation (WCF)
Distribution of functionality Webservice using WCF
Windows Communication Foundation and Web Services
Windows Communication Foundation
Windows Communication Foundation (WCF)
Presented by: Francisco Martin-Recuerda
Jim Fawcett CSE681 – SW Modeling & Analysis Fall 2018
Presentation transcript:

Nati Dobkin

What about OOP? Instance Management Events Asynchronies calls Advanced Bindings Transactions Extending Contract behavior Exercise

Is there such a thing OOP in WCF?

Use KnownTypeAttribute(type) to indicate base class what type are derived from it The type assign to this attribute have to be in driving list of the base class Person -> child -> baby All types have to be Serializable Other OOP element will not work properly

Use ServiceKnownTypeAttribute(type) to indicate type which is Serializable but cannot be added KnownTypeAttribute on it Use svcutil.exe to generate the data contracts Use /Refrence: option to indicate the data contracts assembly

What about OOP? Instance Management Events Asynchronies calls Advanced Bindings Transactions Extending Contract behavior Exercise

Modes of Service Instances Per-call A new service instance is created and destroyed for every call Per-session (default) One service instance per client Clients cannot share instance with other clients Single All Clients share same service instance Use InstanceContextMode of ServiceBehavior Attribute to indicate it

WCF can maintain a private session between a client and a particular service instance. The client session has one service instance per proxy. You can enable session at contract level [ServiceContract(SessionMode = SessionMode.Required )] public interface IMyContract {…} [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerSession)] public class MyService : IMyContract {…} [ServiceContract(SessionMode = SessionMode.Required )] public interface IMyContract {…} [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerSession)] public class MyService : IMyContract {…}

Binding Name Session Transaction Duplex Streaming BasicHttpBindingX WsHttpBindingXXX WsDualHttpBindingXXXX NetTcpBindingXXXX NetNamedPipesBindingXXXX NetMsmqBindingX NetPeerTcpBindingX MsmqIntegrationBindingX

Create an instance of a proxy Close the proxy when you done

User the InstanceContextMode property of ServiceBehavior to indicate the instance mode The default instance mode is PerSession On client side ALWAYS close the connection to the server when you done using it

What about OOP? Instance Management Events Asynchronies calls Advanced Bindings Transactions Extending Contract behavior Exercise

Client server style event handling Service Client callbackcallback We need dual channel

Binding Name Session Transaction Duplex Streaming BasicHttpBindingX WsHttpBindingXXX WsDualHttpBindingXXXX NetTcpBindingXXXX NetNamedPipesBindingXXXX NetMsmqBindingX NetPeerTcpBindingX MsmqIntegrationBindingX

Use dual channel binding Declare the callback interface Add CallbackContract property of ServiceContractAttribute to indicate the callback interface Call OperationContext.Current.GetCallbackChannel to get the callback interface Fire callback interface methods in your free time

Implement callback interface Creare InstanceContext and which takes the implemented callback class and send it to proxy ctor Call OperationContext.Current.GetCallbackChannel to get the callback interface

What about OOP? Instance Management Events Asynchronies calls Advanced Bindings Transactions Extending Contract behavior Exercise

Server – use standard service contract Client – Implement standard Async pattern on service contract methods User AsyncPattern propertie of OperationContract Attribute to tell WCF that it is a async call

What about OOP? Instance Management Events Asynchronies calls Advanced Bindings Transactions Extending Contract behavior Exercise

Binding Name Transport Encoding Interop Security Session Transaction Duplex Streaming BasicHttpBindingHTTP/SText.MTOMBP 1.1 TX WsHttpBindingHTTP/SText.MTOMWST | SXXX WsDualHttpBindingHTTP/SText.MTOMWST | SXXXX NetTcpBindingTCPBinary.NETT | SXXXX NetNamedPipeBindingIPCBinary.NETT | SXXXX NetMsmqBindingMSMQBinary.NETT | SX NetPeerTcpBindingP2PBinary.NETT | SX MsmqIntegrationBindingMSMQBinaryMSMQ TX

NetNamedPipeBinding: Communication between WCF applications on same computer NetMsmqBinding: Communication between WCF applications by using queuing NetPeerTcpBinding: Communication between computers across peer-to-peer services MsmqIntegrationBinding: Communication directly with MSMQ applications

What about OOP? Instance Management Events Asynchronies calls Advanced Bindings Transactions Extending Contract behavior Exercise

WCF provides a rich set of features that enable to create distributed transactions in Web service application. Binding Name Session Transactio n Duplex Streaming BasicHttpBindingX WsHttpBindingXXX WsDualHttpBindingXXXX NetTcpBindingXXXX NetNamedPipesBindingXXXX NetMsmqBindingX NetPeerTcpBindingX MsmqIntegrationBindingX

Client Transaction Service must use client transaction Client/Service Transaction Service joins client transaction if client flows one Service is root of new transaction if no transaction was propagated Service Transaction Service performs transactional work outside scope of client transaction

Use TransactionFlow attribute specifies if the client transaction can flow to service Specify a transaction flow option on the contract methods that should flow a transaction [ServiceContract ] public interface IMyContract { [OperationContract] [TransactionFlow(TransactionFlowOption.Mandatory)] void MyMethod(…); }

Specify a transactional behavioral attribute on the methods, using TransactionScopeRequired property. public class MyService : IMyContract { [OperationBehavior(TransactionScopeRequired = true)] public string MyMethod(…) { … }

Create a TransactionScope (system.Transactions) Defines a region within which a transaction is active Call the service methods on the client Commit the transaction using (TransactionScope tx = new TransactionScope (TransactionScopeOption.RequiresNew)) { proxy.MyMethod(); tx.Complete(); }

What about OOP? Instance Management Events Asynchronies calls Advanced Bindings Transactions Extending Contract behavior Exercise

What do we want to achieve? An ability to interfere on contract operation invocation Dispatcher – basic unit of all data contract behaviors Located in System.ServiceModel.Dispatcher there are four of them ChannelDispatcher EndpointDispatcher DispatcherRuntime DispatcherOperation

A Binding AA BB Message Layer Service Model Layer (Dispatchers) ContractBehaviors CDCD EDED EDED DRDR DRDR DODO DODO DODO DODO Service Method4 Method3 Method2 Method1

Summary How to implement inheritance How to manage instance to server/client How to make event style architecture and async calls How to choose the right binding for your endpoint How to use transactions Dispatchers and how to extend contract behavior

Related Resources (You are not alone out there) WCF Blogs Israeli Bloggers

Related Resources (You are not alone out there) On my Book Shelf Programming WCF Services Microsoft® Windows® Communication Foundation Hands-on! Inside Microsoft Windows Communication Foundation Programming “Indigo”

Shani’s contact information Blog: Thank you Nati’s contact information Blog: