SlideShare una empresa de Scribd logo
1 de 49
Distributed Applications,
Web Services, and WCF


  Yaniv Pessach
About the Presenter
  As a key member of Microsoft Web Services design
    team, he was responsible for several of the key
    patents implemented in the .NET WCF
    implementation, and is a named contributor to
    two of the WS-* standards (WS-Discovery and
    WS-Soap-over-UDP)
Introduction

  • Web Services
    − What are they
    − Why/When to use
    − How to design for (SOA)
    − Technologies (legacy)
    − WCF
Take-away
• Web Services enable a new way of building distributed
  applications in a loosely coupled, independent way
• Web Services are based on layers of standards and
  building blocks which are supported by modern tools
• Service Oriented Architecture starts by thinking of the
  interfaces first; useful enterprise patterns exist
• .NET 3.0 introduced Windows Communication Foundation
  which obsoletes previous communication frameworks
• WCF exposes easy access to most WS layers
• WCF is based on a Contract, Binding, and Address
Agenda
• Web Services Concepts
   − Introducing the web services concepts
   − Case study - car dealership – discussion
• Building Web Services
   − Existing building blocks and standards
   − Principles of SOA
   − The car dealership architecture – discussion
• Web Services Technology
   − Legacy Technologies
   − .NET 3.0 / WCF [20] concepts
       • MiniSample [10] The WCF car dealer
Web Services Properties
• Contract defines interaction
• Loosely Coupled, avoid dependencies
• True Platform Independence
• Build, maintain, version, deploy separately
• External, Internal, Intra-application
Message Exchange Patterns
• Synchronous, Asynchronous, Fire & forget
• Uncorrelated/Correlated by transport/Msg
• Request/Response (RPC style) vs. Publish /
  Subscribe vs. One-Way
• Multicast
• Queuing helps logical fire & forget
The Fjord Dealership
• Dealer buys cars, sells cars
• Deals with other dealers (get cars on lot)
• Verify VIN
• Approve Loan
• Accept Credit-cards
• Etc.
Discussion: Identify WS
• In groups, discuss the needed web services
  − External
  − Internal
  − Reliability, performance, data requirements?
Web Services Layers
• Base standards
• Logical Protocol
• Semantic Protocols                  ws-     Orch
                                   transact   estra
                                              tion

                               Ws-policy               WSDL
                     ws-security        ws-discovery


                        XML         SOAP      SOAP ws-addr
                                              OVER
                                              *
Standards
• Transports          • WS-Reliability
• WSDL                • WS-transaction
• WS-Addressing       • WS-Orchestration
• Profiles and WS-I   • UDDI and WS-
• WS-Security           Discovery
WS-Addressing
• How do we identify a service? EPR
• URI or URI + RefProp
• <wsa:EndpointReference …>
  <wsa:Address>http://www.b.com/1</wsa:Address>
  <wsa:ReferenceProperties>
  <blah:CustomerKey>123456789</fblah:CustomerKey>
  </wsa:ReferenceProperties>
  </wsa:EndpointReference>

• MessageID, RelatesTo, Action
[WS-]SOAP Over TCP
• Wire format
• HTTP no longer transport of choice
• Performance
• No transport level security (https)
• Also – Soap Over UDP
• Connection sharing [non-standard]
WS-Security
• HTTPS only provides transport level
  security – consider the intermediary
• Integrity & confidentiality
• Using SOAP header
• Username, X.509, Kerberos, XML Sig
• Performance vs. TLS ?
WS-Discovery vs. UDDI
• Using discovery
  − .NET vs. java ‘locator’ thinking
• UDDI successes and failures
  − Trust, Service Definition
• WS-Discovery
  − limited scope
  − Present and Future
SOA
• Contract
• Encapsulate
• Distinct Service
• Services exchange data, not share behavior
Loose Coupling
• Sacrifices interface optimization
• Achieve flexible interoperability
• .. And ease of change
• .. And does not come naturally
Loose and Tight Coupling
                                      Tightly        Loosely

 Msg Style                            RPC            Doc

 Msg Path                             Hardcode       Route

 Technology                           Homogenous     Heterogeneous

 Binding                              Early, fixed   Late

 Interaction                          Synchronous    Asynchronous

 Model                                Reuse          Broad applicability

 Adaptation                           Recoding       Transformation

 Behavior                             Anticipated    Unexpected


* Adapted from ‘loosely coupled’ by Doug Kaye
SOA Patterns
• Self Service Client
• Service Locator (mostly Javathink)
• Broker, Router Variation, XML firewall
• Serial and Parallel process pattern
• Cached object pattern
• Queue and MessageBus
• Pub/Sub and distributed observer pattern
SOA Patterns - Implementation
• The Message is the Media
• Contract First/Contract Second
• Fowlerisms
  − Service Layer
  − Transform View
  − Remote Façade
  − Data Transfer Object
  − Service Stub [testing]
Architect Fjord WS
• Major Services
• Building Blocks
• Discussion!
Legacy Technologies
• Microsoft
  − RPC
  − DCOM
  − .NET 1.1 Remoting
  − .NET 1.1 WS
• Issues
  − Interoperability
  − Specific limitations
WCF Presented
• Released in .NET 3.0
• Diverse Stack
• Address / Binding / Contract
• Unique Features
  − Existing building blocks
  − Ease of implementation, deployment, maint
  − XML compression, performance
ABC
• Address, Binding, Contract
  − EPR
  − System bindings, parameters, custom, and
    custom channels
  − Interface/class
Topics
• Hosting
• Channels and extensibility
  − Existing channels, transports, reliability,
    security
• Profiles
• Configuration
Code: Contract
[ServiceContract()] public interface ISellCar
{
    [OperationContract] double price(int vin);
    [OperationContract (IsOneWay=true)]
    Void notifyInterest(int vin);
}
Code: Client
• Svcutil.exe http://...?wsdl


using (CarProxy proxy = new CarProxy())
{
    double result = proxy.price(617894332);
}
Code: Server
• Impl: public class CarService: ISellCar {….}
• Hosted: something.svc
<@Service language=c# class=“….CarService“ %>
• SelfHost: using (ServiceHost host = new
  ServiceHost(typeof(CarService), new
  Uri("http://..."))) { host.Open();
  Thread.Sleep(1000000); host.Close(); }
Config: Server [1]
<configuration …. > <system.serviceModel>
  <services> <service
  behaviorConfiguration=“CarServiceBehavior"
  type=…. > <endpoint address=""
  binding="wsHttpBinding"
  bindingConfiguration="Binding1"
  contract=“….ISellCar" /> </service> </services>
Config: Server [2]
<configurationName=“CarServiceBehavior"
  returnUnknownExceptionsAsFaults="True">
  </behavior> </behaviors>
<bindings> <wsHttpBinding> <binding
  configurationName="Binding1" />
  </wsHttpBinding> </bindings>
  </system.serviceModel>
</configuration>
Fjord With WCF
• Construct pseudo/code
• Discussion!
Take-away and Summary
Use Web Services for applications, components
Use Standards (WS-*) and building blocks
Architect using SOA patterns (routers, locators…)
Use .NET 3.0/WCF as communication layer
Define the Contract; configure Binding, and
  Address
Add on transports, reliability, security
More Information

• http://www.yanivpessach.com/soa_read
  more.txt
• Contact me – yaniv@yanivpessach.com
Backup slides
Web Services Defined
• Interoperable machine-to-machine
  interaction
• Using SOAP and XML (some use REST)
• Service and Contract
• Message
• SOA (service oriented architecture)
Sending Out An S.O.A
• The Need for SOA
• Real world problems
• Integration Nightmares
• Increasing Complexity
SOAP Sample
<soap:Envelope
mlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
   <soap:Body>
      <getProductDetailsxmlns=…>
         <productID>827635</productID>
      </getProductDetails>
   </soap:Body>
</soap:Envelope>
WS Layered Usage
• External
  − E.g. process credit card transaction
• Internal (‘inside the firewall’)
  − EAI e.g. accounting to helpdesk apps
• Intra-application
  − Modular design, flexibility, common blocks
Benefits Revisited
• Built separately
  − different teams, timelines, platforms
  − enable focused teams
  − minimize accidental dependencies
• Deployed separately
  − Performance, troubleshooting, versioning
Web Services Properties
• Contract defines interaction
• Loosely Coupled
Standards – Time is right




* Source: Computer Networks Fourth Edition , Andrew Tanenbaum
Standards – discuss specifics
• Important
• Tool support
• Too many to choose from
WS-Transaction
• Long lived transaction
• Problems of 2-phase commit
• Based on roll-back
• Flexible
WS-Orchestration
• Upper level integration
• Relies on lower levels
• Stabilizing
• Think of it as BizTalk
More WFC building blocks
• Transactions
• Behaviors
  − Lifetime
Code: Channel Programming
encoder = new TextMessageEncodingBindingElement();
transport = new TcpTransportBindingElement();
binding = new CustomBinding(encoder, transport);
IChannelFactory<IRequestChannel> factory =
   binding.BuildChannelFactory<IRequestChannel>(); factory.Open();
address = new EndpointAddress("net.tcp://192.168.0.2:5555/");
IRequestChannel channel = factory.CreateChannel(address); channel.Open();
request = Message.CreateMessage(factory.MessageVersion, "hello");
reply = channel.Request(request);
Console.Out.WriteLine(reply.Headers.Action);
reply.Close(); channel.Close(); factory.Close(); } }
Code: Reliability
BindingElementCollection bindingElements = new BindingElementCollection();
   ReliableSessionBindingElement session = new
   ReliableSessionBindingElement(); session.Ordered = true;
   bindingElements.Add(session); bindingElements.Add(new
   CompositeDuplexBindingElement()); bindingElements.Add(new
   UdpTransportBindingElement()); Binding playerInfoBinding = new
   CustomBinding(bindingElements);
Code: Reliability
BindingElementCollection bindingElements = new BindingElementCollection();
   ReliableSessionBindingElement session = new
   ReliableSessionBindingElement(); session.Ordered = true;
   bindingElements.Add(session); bindingElements.Add(new
   CompositeDuplexBindingElement()); bindingElements.Add(new
   UdpTransportBindingElement()); Binding playerInfoBinding = new
   CustomBinding(bindingElements);
Uri playerInfoAddress = new Uri( "soap.udp://localhost:16000/");
using(ServiceHost service = new ServiceHost(typeof(playerInfoService))) {
   service.AddServiceEndpoint(typeof(IUpdatePlayerInfoContract),
   playerInfoBinding, playerInfoAddress); service.Open();
... // more service code here }
Code: Callback (and duplex)
interface IMyContractCallback { [OperationContract] void OnCallback(); }
[ServiceContract(CallbackContract = typeof(IMyContractCallback))]
interface IMyContract { [OperationContract] void DoSomething(); }
public sealed class InstanceContext : CommunicationObject, ... { public
   InstanceContext(object implementation); ... // More members }
class MyCallback : IMyContractCallback { public void OnCallback() {...} }
   IMyContractCallback callback = new MyCallback(); InstanceContext context =
   new InstanceContext(callback);
IMyContractCallback callback = new MyCallback(); InstanceContext context =
   new InstanceContext(callback); MyContractClient proxy = new
   MyContractClient(context); proxy.DoSomething();

Más contenido relacionado

La actualidad más candente

ASP.NET 4 & Web Dev in Visual Studio 2010 - Alex Mackey, Readify
ASP.NET 4 & Web Dev in Visual Studio 2010 - Alex Mackey, ReadifyASP.NET 4 & Web Dev in Visual Studio 2010 - Alex Mackey, Readify
ASP.NET 4 & Web Dev in Visual Studio 2010 - Alex Mackey, ReadifyREADIFY
 
Web changesandasp4 upload
Web changesandasp4 uploadWeb changesandasp4 upload
Web changesandasp4 uploadREADIFY
 
Azure Services Platform Oc Event Ned
Azure Services Platform Oc Event NedAzure Services Platform Oc Event Ned
Azure Services Platform Oc Event NedWes Yanaga
 
Visual Studio 2010 IDE Enhancements - Alex Mackey, Readify
Visual Studio 2010 IDE Enhancements - Alex Mackey, ReadifyVisual Studio 2010 IDE Enhancements - Alex Mackey, Readify
Visual Studio 2010 IDE Enhancements - Alex Mackey, ReadifyREADIFY
 
Chapter10 web
Chapter10 webChapter10 web
Chapter10 webREADIFY
 
Service-Oriented Architecture (SOA)
Service-Oriented Architecture (SOA)Service-Oriented Architecture (SOA)
Service-Oriented Architecture (SOA)WSO2
 
Manageability of Windows Azure BizTalk Services (WABS)
Manageability of Windows Azure BizTalk Services (WABS)Manageability of Windows Azure BizTalk Services (WABS)
Manageability of Windows Azure BizTalk Services (WABS)BizTalk360
 
Oracle BPEL Presentation
Oracle BPEL PresentationOracle BPEL Presentation
Oracle BPEL Presentationshub54
 
Arquitectura orientada a servicios
Arquitectura orientada a serviciosArquitectura orientada a servicios
Arquitectura orientada a serviciosbrizna39
 
Sharepoint 2010 Geliştirme Araçları
Sharepoint 2010 Geliştirme AraçlarıSharepoint 2010 Geliştirme Araçları
Sharepoint 2010 Geliştirme AraçlarıÇözümPARK
 
Oracle soa/Fusion developer
Oracle soa/Fusion developerOracle soa/Fusion developer
Oracle soa/Fusion developerSudhakar P
 
Design & Implementation Issues in a Contemporary Remote Laboratory Architecture
Design & Implementation Issues in a Contemporary Remote Laboratory ArchitectureDesign & Implementation Issues in a Contemporary Remote Laboratory Architecture
Design & Implementation Issues in a Contemporary Remote Laboratory ArchitectureThe University of Queensland
 
Pro Dev Briefing Irvine Wesyppt23
Pro Dev Briefing Irvine Wesyppt23Pro Dev Briefing Irvine Wesyppt23
Pro Dev Briefing Irvine Wesyppt23Wes Yanaga
 
Hybrid Solutions with the current BizTalk Server 2013 R2 platform
Hybrid Solutions with the current BizTalk Server 2013 R2 platformHybrid Solutions with the current BizTalk Server 2013 R2 platform
Hybrid Solutions with the current BizTalk Server 2013 R2 platformBizTalk360
 
Introducing SOA and Oracle SOA Suite 11g for Database Professionals
Introducing SOA and Oracle SOA Suite 11g for Database ProfessionalsIntroducing SOA and Oracle SOA Suite 11g for Database Professionals
Introducing SOA and Oracle SOA Suite 11g for Database ProfessionalsLucas Jellema
 
Apache Etch Introduction @ FOSDEM 2011
Apache Etch Introduction @ FOSDEM 2011Apache Etch Introduction @ FOSDEM 2011
Apache Etch Introduction @ FOSDEM 2011grandyho
 
Web services and SOA
Web services and SOAWeb services and SOA
Web services and SOASubin Sugunan
 
WCF LOB SDK at CNUG
WCF LOB SDK at CNUGWCF LOB SDK at CNUG
WCF LOB SDK at CNUGclineer
 

La actualidad más candente (20)

Hindes_Active_2016Gz2
Hindes_Active_2016Gz2Hindes_Active_2016Gz2
Hindes_Active_2016Gz2
 
ASP.NET 4 & Web Dev in Visual Studio 2010 - Alex Mackey, Readify
ASP.NET 4 & Web Dev in Visual Studio 2010 - Alex Mackey, ReadifyASP.NET 4 & Web Dev in Visual Studio 2010 - Alex Mackey, Readify
ASP.NET 4 & Web Dev in Visual Studio 2010 - Alex Mackey, Readify
 
Web changesandasp4 upload
Web changesandasp4 uploadWeb changesandasp4 upload
Web changesandasp4 upload
 
Azure Services Platform Oc Event Ned
Azure Services Platform Oc Event NedAzure Services Platform Oc Event Ned
Azure Services Platform Oc Event Ned
 
Visual Studio 2010 IDE Enhancements - Alex Mackey, Readify
Visual Studio 2010 IDE Enhancements - Alex Mackey, ReadifyVisual Studio 2010 IDE Enhancements - Alex Mackey, Readify
Visual Studio 2010 IDE Enhancements - Alex Mackey, Readify
 
Chapter10 web
Chapter10 webChapter10 web
Chapter10 web
 
Service-Oriented Architecture (SOA)
Service-Oriented Architecture (SOA)Service-Oriented Architecture (SOA)
Service-Oriented Architecture (SOA)
 
WCF
WCFWCF
WCF
 
Manageability of Windows Azure BizTalk Services (WABS)
Manageability of Windows Azure BizTalk Services (WABS)Manageability of Windows Azure BizTalk Services (WABS)
Manageability of Windows Azure BizTalk Services (WABS)
 
Oracle BPEL Presentation
Oracle BPEL PresentationOracle BPEL Presentation
Oracle BPEL Presentation
 
Arquitectura orientada a servicios
Arquitectura orientada a serviciosArquitectura orientada a servicios
Arquitectura orientada a servicios
 
Sharepoint 2010 Geliştirme Araçları
Sharepoint 2010 Geliştirme AraçlarıSharepoint 2010 Geliştirme Araçları
Sharepoint 2010 Geliştirme Araçları
 
Oracle soa/Fusion developer
Oracle soa/Fusion developerOracle soa/Fusion developer
Oracle soa/Fusion developer
 
Design & Implementation Issues in a Contemporary Remote Laboratory Architecture
Design & Implementation Issues in a Contemporary Remote Laboratory ArchitectureDesign & Implementation Issues in a Contemporary Remote Laboratory Architecture
Design & Implementation Issues in a Contemporary Remote Laboratory Architecture
 
Pro Dev Briefing Irvine Wesyppt23
Pro Dev Briefing Irvine Wesyppt23Pro Dev Briefing Irvine Wesyppt23
Pro Dev Briefing Irvine Wesyppt23
 
Hybrid Solutions with the current BizTalk Server 2013 R2 platform
Hybrid Solutions with the current BizTalk Server 2013 R2 platformHybrid Solutions with the current BizTalk Server 2013 R2 platform
Hybrid Solutions with the current BizTalk Server 2013 R2 platform
 
Introducing SOA and Oracle SOA Suite 11g for Database Professionals
Introducing SOA and Oracle SOA Suite 11g for Database ProfessionalsIntroducing SOA and Oracle SOA Suite 11g for Database Professionals
Introducing SOA and Oracle SOA Suite 11g for Database Professionals
 
Apache Etch Introduction @ FOSDEM 2011
Apache Etch Introduction @ FOSDEM 2011Apache Etch Introduction @ FOSDEM 2011
Apache Etch Introduction @ FOSDEM 2011
 
Web services and SOA
Web services and SOAWeb services and SOA
Web services and SOA
 
WCF LOB SDK at CNUG
WCF LOB SDK at CNUGWCF LOB SDK at CNUG
WCF LOB SDK at CNUG
 

Similar a SOA and WCF (Windows Communication Foundation) basics

SOA - Unit 1 - Introduction to SOA with Web Services
SOA - Unit   1 - Introduction to SOA with Web ServicesSOA - Unit   1 - Introduction to SOA with Web Services
SOA - Unit 1 - Introduction to SOA with Web Serviceshamsa nandhini
 
Enterprise Use Case - Selecting an Enterprise Service Bus
Enterprise Use Case - Selecting an Enterprise Service Bus Enterprise Use Case - Selecting an Enterprise Service Bus
Enterprise Use Case - Selecting an Enterprise Service Bus WSO2
 
SUE AGILE Architecture (English)
SUE AGILE Architecture (English)SUE AGILE Architecture (English)
SUE AGILE Architecture (English)Sabino Labarile
 
Middleware in the cloud platform-v2
Middleware in the cloud   platform-v2Middleware in the cloud   platform-v2
Middleware in the cloud platform-v2Hammad Rajjoub
 
Achieve business agility with Cloud APIs, Cloud-aware Apps, and Cloud DevOps ...
Achieve business agility with Cloud APIs, Cloud-aware Apps, and Cloud DevOps ...Achieve business agility with Cloud APIs, Cloud-aware Apps, and Cloud DevOps ...
Achieve business agility with Cloud APIs, Cloud-aware Apps, and Cloud DevOps ...Chris Haddad
 
MS TechDays 2011 - How to Run Middleware in the Cloud Story of Windows Azure ...
MS TechDays 2011 - How to Run Middleware in the Cloud Story of Windows Azure ...MS TechDays 2011 - How to Run Middleware in the Cloud Story of Windows Azure ...
MS TechDays 2011 - How to Run Middleware in the Cloud Story of Windows Azure ...Spiffy
 
web services-May 25.ppt
web services-May 25.pptweb services-May 25.ppt
web services-May 25.pptShivaangiKrish
 
Designing microservices part2
Designing microservices part2Designing microservices part2
Designing microservices part2Masashi Narumoto
 
ESB Evaluation Framework
ESB Evaluation FrameworkESB Evaluation Framework
ESB Evaluation FrameworkWSO2
 
Web services concepts, protocols and development
Web services concepts, protocols and developmentWeb services concepts, protocols and development
Web services concepts, protocols and developmentishmecse13
 
Hybrid integration platform reference architecture
Hybrid integration platform reference architectureHybrid integration platform reference architecture
Hybrid integration platform reference architectureChanaka Fernando
 
D1-3-Signaling
D1-3-SignalingD1-3-Signaling
D1-3-SignalingOleg Levy
 
Azure reference architectures
Azure reference architecturesAzure reference architectures
Azure reference architecturesMasashi Narumoto
 
complete web service1.ppt
complete web service1.pptcomplete web service1.ppt
complete web service1.pptDr.Saranya K.G
 
Web Services Hacking and Security
Web Services Hacking and SecurityWeb Services Hacking and Security
Web Services Hacking and SecurityBlueinfy Solutions
 
Micro service session 1
Micro service   session 1Micro service   session 1
Micro service session 1Amin Arab
 

Similar a SOA and WCF (Windows Communication Foundation) basics (20)

oracle service bus
oracle service busoracle service bus
oracle service bus
 
SOA - Unit 1 - Introduction to SOA with Web Services
SOA - Unit   1 - Introduction to SOA with Web ServicesSOA - Unit   1 - Introduction to SOA with Web Services
SOA - Unit 1 - Introduction to SOA with Web Services
 
Enterprise Use Case - Selecting an Enterprise Service Bus
Enterprise Use Case - Selecting an Enterprise Service Bus Enterprise Use Case - Selecting an Enterprise Service Bus
Enterprise Use Case - Selecting an Enterprise Service Bus
 
SUE AGILE Architecture (English)
SUE AGILE Architecture (English)SUE AGILE Architecture (English)
SUE AGILE Architecture (English)
 
Middleware in the cloud platform-v2
Middleware in the cloud   platform-v2Middleware in the cloud   platform-v2
Middleware in the cloud platform-v2
 
Achieve business agility with Cloud APIs, Cloud-aware Apps, and Cloud DevOps ...
Achieve business agility with Cloud APIs, Cloud-aware Apps, and Cloud DevOps ...Achieve business agility with Cloud APIs, Cloud-aware Apps, and Cloud DevOps ...
Achieve business agility with Cloud APIs, Cloud-aware Apps, and Cloud DevOps ...
 
MS TechDays 2011 - How to Run Middleware in the Cloud Story of Windows Azure ...
MS TechDays 2011 - How to Run Middleware in the Cloud Story of Windows Azure ...MS TechDays 2011 - How to Run Middleware in the Cloud Story of Windows Azure ...
MS TechDays 2011 - How to Run Middleware in the Cloud Story of Windows Azure ...
 
web services-May 25.ppt
web services-May 25.pptweb services-May 25.ppt
web services-May 25.ppt
 
Designing microservices part2
Designing microservices part2Designing microservices part2
Designing microservices part2
 
ESB Evaluation Framework
ESB Evaluation FrameworkESB Evaluation Framework
ESB Evaluation Framework
 
Global Windows Azure Bootcamp - San Diego
Global Windows Azure Bootcamp - San DiegoGlobal Windows Azure Bootcamp - San Diego
Global Windows Azure Bootcamp - San Diego
 
Web services concepts, protocols and development
Web services concepts, protocols and developmentWeb services concepts, protocols and development
Web services concepts, protocols and development
 
Hybrid integration platform reference architecture
Hybrid integration platform reference architectureHybrid integration platform reference architecture
Hybrid integration platform reference architecture
 
D1-3-Signaling
D1-3-SignalingD1-3-Signaling
D1-3-Signaling
 
Designing microservices
Designing microservicesDesigning microservices
Designing microservices
 
Azure reference architectures
Azure reference architecturesAzure reference architectures
Azure reference architectures
 
Wcf v1-day1
Wcf v1-day1Wcf v1-day1
Wcf v1-day1
 
complete web service1.ppt
complete web service1.pptcomplete web service1.ppt
complete web service1.ppt
 
Web Services Hacking and Security
Web Services Hacking and SecurityWeb Services Hacking and Security
Web Services Hacking and Security
 
Micro service session 1
Micro service   session 1Micro service   session 1
Micro service session 1
 

Último

Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 

Último (20)

Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 

SOA and WCF (Windows Communication Foundation) basics

  • 2. About the Presenter As a key member of Microsoft Web Services design team, he was responsible for several of the key patents implemented in the .NET WCF implementation, and is a named contributor to two of the WS-* standards (WS-Discovery and WS-Soap-over-UDP)
  • 3. Introduction • Web Services − What are they − Why/When to use − How to design for (SOA) − Technologies (legacy) − WCF
  • 4. Take-away • Web Services enable a new way of building distributed applications in a loosely coupled, independent way • Web Services are based on layers of standards and building blocks which are supported by modern tools • Service Oriented Architecture starts by thinking of the interfaces first; useful enterprise patterns exist • .NET 3.0 introduced Windows Communication Foundation which obsoletes previous communication frameworks • WCF exposes easy access to most WS layers • WCF is based on a Contract, Binding, and Address
  • 5. Agenda • Web Services Concepts − Introducing the web services concepts − Case study - car dealership – discussion • Building Web Services − Existing building blocks and standards − Principles of SOA − The car dealership architecture – discussion • Web Services Technology − Legacy Technologies − .NET 3.0 / WCF [20] concepts • MiniSample [10] The WCF car dealer
  • 6. Web Services Properties • Contract defines interaction • Loosely Coupled, avoid dependencies • True Platform Independence • Build, maintain, version, deploy separately • External, Internal, Intra-application
  • 7. Message Exchange Patterns • Synchronous, Asynchronous, Fire & forget • Uncorrelated/Correlated by transport/Msg • Request/Response (RPC style) vs. Publish / Subscribe vs. One-Way • Multicast • Queuing helps logical fire & forget
  • 8. The Fjord Dealership • Dealer buys cars, sells cars • Deals with other dealers (get cars on lot) • Verify VIN • Approve Loan • Accept Credit-cards • Etc.
  • 9. Discussion: Identify WS • In groups, discuss the needed web services − External − Internal − Reliability, performance, data requirements?
  • 10. Web Services Layers • Base standards • Logical Protocol • Semantic Protocols ws- Orch transact estra tion Ws-policy WSDL ws-security ws-discovery XML SOAP SOAP ws-addr OVER *
  • 11. Standards • Transports • WS-Reliability • WSDL • WS-transaction • WS-Addressing • WS-Orchestration • Profiles and WS-I • UDDI and WS- • WS-Security Discovery
  • 12. WS-Addressing • How do we identify a service? EPR • URI or URI + RefProp • <wsa:EndpointReference …> <wsa:Address>http://www.b.com/1</wsa:Address> <wsa:ReferenceProperties> <blah:CustomerKey>123456789</fblah:CustomerKey> </wsa:ReferenceProperties> </wsa:EndpointReference> • MessageID, RelatesTo, Action
  • 13. [WS-]SOAP Over TCP • Wire format • HTTP no longer transport of choice • Performance • No transport level security (https) • Also – Soap Over UDP • Connection sharing [non-standard]
  • 14. WS-Security • HTTPS only provides transport level security – consider the intermediary • Integrity & confidentiality • Using SOAP header • Username, X.509, Kerberos, XML Sig • Performance vs. TLS ?
  • 15. WS-Discovery vs. UDDI • Using discovery − .NET vs. java ‘locator’ thinking • UDDI successes and failures − Trust, Service Definition • WS-Discovery − limited scope − Present and Future
  • 16. SOA • Contract • Encapsulate • Distinct Service • Services exchange data, not share behavior
  • 17. Loose Coupling • Sacrifices interface optimization • Achieve flexible interoperability • .. And ease of change • .. And does not come naturally
  • 18. Loose and Tight Coupling Tightly Loosely Msg Style RPC Doc Msg Path Hardcode Route Technology Homogenous Heterogeneous Binding Early, fixed Late Interaction Synchronous Asynchronous Model Reuse Broad applicability Adaptation Recoding Transformation Behavior Anticipated Unexpected * Adapted from ‘loosely coupled’ by Doug Kaye
  • 19. SOA Patterns • Self Service Client • Service Locator (mostly Javathink) • Broker, Router Variation, XML firewall • Serial and Parallel process pattern • Cached object pattern • Queue and MessageBus • Pub/Sub and distributed observer pattern
  • 20. SOA Patterns - Implementation • The Message is the Media • Contract First/Contract Second • Fowlerisms − Service Layer − Transform View − Remote Façade − Data Transfer Object − Service Stub [testing]
  • 21. Architect Fjord WS • Major Services • Building Blocks • Discussion!
  • 22. Legacy Technologies • Microsoft − RPC − DCOM − .NET 1.1 Remoting − .NET 1.1 WS • Issues − Interoperability − Specific limitations
  • 23. WCF Presented • Released in .NET 3.0 • Diverse Stack • Address / Binding / Contract • Unique Features − Existing building blocks − Ease of implementation, deployment, maint − XML compression, performance
  • 24. ABC • Address, Binding, Contract − EPR − System bindings, parameters, custom, and custom channels − Interface/class
  • 25. Topics • Hosting • Channels and extensibility − Existing channels, transports, reliability, security • Profiles • Configuration
  • 26. Code: Contract [ServiceContract()] public interface ISellCar { [OperationContract] double price(int vin); [OperationContract (IsOneWay=true)] Void notifyInterest(int vin); }
  • 27. Code: Client • Svcutil.exe http://...?wsdl using (CarProxy proxy = new CarProxy()) { double result = proxy.price(617894332); }
  • 28. Code: Server • Impl: public class CarService: ISellCar {….} • Hosted: something.svc <@Service language=c# class=“….CarService“ %> • SelfHost: using (ServiceHost host = new ServiceHost(typeof(CarService), new Uri("http://..."))) { host.Open(); Thread.Sleep(1000000); host.Close(); }
  • 29. Config: Server [1] <configuration …. > <system.serviceModel> <services> <service behaviorConfiguration=“CarServiceBehavior" type=…. > <endpoint address="" binding="wsHttpBinding" bindingConfiguration="Binding1" contract=“….ISellCar" /> </service> </services>
  • 30. Config: Server [2] <configurationName=“CarServiceBehavior" returnUnknownExceptionsAsFaults="True"> </behavior> </behaviors> <bindings> <wsHttpBinding> <binding configurationName="Binding1" /> </wsHttpBinding> </bindings> </system.serviceModel> </configuration>
  • 31. Fjord With WCF • Construct pseudo/code • Discussion!
  • 32. Take-away and Summary Use Web Services for applications, components Use Standards (WS-*) and building blocks Architect using SOA patterns (routers, locators…) Use .NET 3.0/WCF as communication layer Define the Contract; configure Binding, and Address Add on transports, reliability, security
  • 33. More Information • http://www.yanivpessach.com/soa_read more.txt • Contact me – yaniv@yanivpessach.com
  • 35. Web Services Defined • Interoperable machine-to-machine interaction • Using SOAP and XML (some use REST) • Service and Contract • Message • SOA (service oriented architecture)
  • 36. Sending Out An S.O.A • The Need for SOA • Real world problems • Integration Nightmares • Increasing Complexity
  • 37. SOAP Sample <soap:Envelope mlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <getProductDetailsxmlns=…> <productID>827635</productID> </getProductDetails> </soap:Body> </soap:Envelope>
  • 38. WS Layered Usage • External − E.g. process credit card transaction • Internal (‘inside the firewall’) − EAI e.g. accounting to helpdesk apps • Intra-application − Modular design, flexibility, common blocks
  • 39. Benefits Revisited • Built separately − different teams, timelines, platforms − enable focused teams − minimize accidental dependencies • Deployed separately − Performance, troubleshooting, versioning
  • 40. Web Services Properties • Contract defines interaction • Loosely Coupled
  • 41. Standards – Time is right * Source: Computer Networks Fourth Edition , Andrew Tanenbaum
  • 42. Standards – discuss specifics • Important • Tool support • Too many to choose from
  • 43. WS-Transaction • Long lived transaction • Problems of 2-phase commit • Based on roll-back • Flexible
  • 44. WS-Orchestration • Upper level integration • Relies on lower levels • Stabilizing • Think of it as BizTalk
  • 45. More WFC building blocks • Transactions • Behaviors − Lifetime
  • 46. Code: Channel Programming encoder = new TextMessageEncodingBindingElement(); transport = new TcpTransportBindingElement(); binding = new CustomBinding(encoder, transport); IChannelFactory<IRequestChannel> factory = binding.BuildChannelFactory<IRequestChannel>(); factory.Open(); address = new EndpointAddress("net.tcp://192.168.0.2:5555/"); IRequestChannel channel = factory.CreateChannel(address); channel.Open(); request = Message.CreateMessage(factory.MessageVersion, "hello"); reply = channel.Request(request); Console.Out.WriteLine(reply.Headers.Action); reply.Close(); channel.Close(); factory.Close(); } }
  • 47. Code: Reliability BindingElementCollection bindingElements = new BindingElementCollection(); ReliableSessionBindingElement session = new ReliableSessionBindingElement(); session.Ordered = true; bindingElements.Add(session); bindingElements.Add(new CompositeDuplexBindingElement()); bindingElements.Add(new UdpTransportBindingElement()); Binding playerInfoBinding = new CustomBinding(bindingElements);
  • 48. Code: Reliability BindingElementCollection bindingElements = new BindingElementCollection(); ReliableSessionBindingElement session = new ReliableSessionBindingElement(); session.Ordered = true; bindingElements.Add(session); bindingElements.Add(new CompositeDuplexBindingElement()); bindingElements.Add(new UdpTransportBindingElement()); Binding playerInfoBinding = new CustomBinding(bindingElements); Uri playerInfoAddress = new Uri( "soap.udp://localhost:16000/"); using(ServiceHost service = new ServiceHost(typeof(playerInfoService))) { service.AddServiceEndpoint(typeof(IUpdatePlayerInfoContract), playerInfoBinding, playerInfoAddress); service.Open(); ... // more service code here }
  • 49. Code: Callback (and duplex) interface IMyContractCallback { [OperationContract] void OnCallback(); } [ServiceContract(CallbackContract = typeof(IMyContractCallback))] interface IMyContract { [OperationContract] void DoSomething(); } public sealed class InstanceContext : CommunicationObject, ... { public InstanceContext(object implementation); ... // More members } class MyCallback : IMyContractCallback { public void OnCallback() {...} } IMyContractCallback callback = new MyCallback(); InstanceContext context = new InstanceContext(callback); IMyContractCallback callback = new MyCallback(); InstanceContext context = new InstanceContext(callback); MyContractClient proxy = new MyContractClient(context); proxy.DoSomething();