messaging with web services enhancements 2 0 n.
Skip this Video
Loading SlideShow in 5 Seconds..
Messaging with Web Services Enhancements 2.0 PowerPoint Presentation
Download Presentation
Messaging with Web Services Enhancements 2.0

Loading in 2 Seconds...

play fullscreen
1 / 46

Messaging with Web Services Enhancements 2.0 - PowerPoint PPT Presentation

  • Uploaded on

Messaging with Web Services Enhancements 2.0. Benjamin Mitchell Independent Consultant Microsoft Regional Director – UK Blog What We Will Cover:. Overview of Web Services Enhancements 2.0 What problems does Messaging solve?

I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
Download Presentation

Messaging with Web Services Enhancements 2.0

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
messaging with web services enhancements 2 0

Messaging with Web Services Enhancements 2.0

Benjamin Mitchell

Independent Consultant

Microsoft Regional Director – UK


what we will cover
What We Will Cover:
  • Overview of Web Services Enhancements 2.0
  • What problems does Messaging solve?
  • Why does Messaging solve them?
  • What types of Messaging models are there?
  • How can I use these programming models today?
web services enhancements
Web Services Enhancements
  • WSE implements many WS-* specifications
    • Simple, low-level object model for developers
    • Available for free download
  • Logically part of the .NET Framework, but kept separate while still evolving
    • Fully supported by Microsoft until at least 2008
      • Version 1.0 Dec 2002, Version 2.0 May 2004
      • Version 2.0 SP 2 pre-release available now
  • Benefits
    • Allows MS to gather real world feedback
    • Allows early adopters to use the latest standards
wse 2 0
WSE 2.0
  • Designed to bring advanced Web Services technologies based on standard protocols to developers
  • Integrates with Visual Studio .NET and .NET Framework
  • What do you get with WSE?
    • WS-Addressing
    • WS-Security
    • WS-Policy
    • WS-SecurityPolicy
    • WS-Trust
    • WS-SecureConversation
    • WS-Referral
    • WS-Attachments
  • Interoperability
how does wse work
How does WSE work?

User Code







Security Token Manager

Custom Filters

problem statement
Problem Statement
  • Issues with connected systems
    • Bandwidth and Latency
    • Domain boundaries
    • Coordination and Management
  • Solution
    • Less transparency
    • More Explicitness
  • Implementation
    • Message-based programming models
  • Transparent programming models are easy
  • But, they obscure:
    • Location of code execution
    • Complete context of execution
  • You don’t know that you don’t know
  • Explicit programming models leave more for the developer to do
  • They do not obscure as much:
    • Network activity is apparent
    • Context and timing is known
  • You know you don’t know so you take precautions
  • Enables communication to offline services
about messaging
About Messaging
  • Several programming models within the "messaging" bucket
    • Eventing (often called Pub/Sub)
    • Dialogs
    • Queues
    • Request-Response
  • Key benefits
    • More natural fit for many business processes
    • Allows for more asynchronous processing
  • Many configurations
    • "Smart" routers
    • Offline machines
    • Etc…
web services and messaging
Web Services and Messaging
  • A way of exposing functionality using a set of interoperable protocols
  • Messages exchanged based on a shared schema
    • Independent of the programming language used
    • No shared classes
        • Unless you intentionally share them
messaging implementations
Messaging Implementations
  • MSMQ
    • Classic
    • Offline Queuing
  • ASMX
    • Easy to use
  • WSE V2
    • Transport Independence
    • Host anywhere
msmq messaging
MSMQ Messaging
  • The classic messaging API
  • MessageQueue class
  • Two important methods
    • Send
    • Receive
  • Can provide reliable, in order, only once delivery as well as transaction support
  • Requires MSMQ at both ends of the pipeline
asmx messaging
ASMX Messaging
  • Easiest way to message with SOAP
  • Create an *.asmx file
  • Write a class
  • Decorate methods with [WebMethod]
  • OneWay or RequestResponse
wse 2 0 messaging
WSE 2.0 Messaging
  • WSE 2.0 includes a SOAP-based messaging API
  • Transport independence
    • Intra-AppDomain
      • For testing
    • Raw TCP
    • HTTP
  • Host Independence
    • Windows application
    • ASP.NET
    • Windows Service
wse 2 0 messaging1
WSE 2.0 Messaging
  • SoapSender and SoapReceiver
    • One way messages
    • Deal with the SoapEnvelope rather than method parameters
    • Must implement method dispatching based on SoapEnvelope.Context.Adressing.Action
    • No automated reply messages
      • The Receiver must implement a new Sender
      • Sender must indicate reply address
demonstration 1

Demonstration 1

SoapSender and SoapReceiver

wse 2 0 messaging continued
WSE 2.0 Messaging (Continued)
  • SoapClient and SoapService
    • One-way and two-way
    • Uses SoapSender/SoapReceiver
    • Offers XML Serialization support
    • Operation-based dispatching
      • The Action is used to deliver the message to a Method
    • Automatic replying
demonstration 2

Demonstration 2

SoapClient and SoapServer

wse 2 0 messaging continued1
WSE 2.0 Messaging (Continued)
  • Channels
    • Queued model
    • Raw, explicit programming
programming models






Programming Models
  • Errors
    • Dead letter channel
    • Faults
  • Gateway
    • Aggregating Gateway
  • Router
programming models receiving
Programming Models: Receiving
  • Push-model


Implicit message receive

Message is processed when message arrives

Allows for Activation

demonstration 3

Demonstration 3

Push-model messaging with ASMX

programming models receiving1
Programming Models: Receiving
  • Polling to receive messages


Explicit message receive

Lets recipient control when message is processed

demonstration 4

Demonstration 4

Message Polling with WSE 2.0

programming models adaptation
Programming Models: Adaptation
  • Application not always messaging aware
  • Too costly to re-code entire app
  • Adapters translate app-specific data and behavior into Messages



programming models adaptation1
Programming Models: Adaptation
  • Message on wire is serialized into common format
  • Message data on system not always serializable
  • Message mapper deals with this




programming models errors
Programming Models - Errors
  • Two errors messaging is well-suited to deal with
    • Dead letters
    • Invalid messages
  • Exceptions
    • Exceptions can occur before dispatch
    • In user code
  • Soap Faults map to Exceptions
    • Fault codes are QNames
design gateway



Design: Gateway
  • Wraps application-specific logic
  • Most Web services are gateways
design gateway1



Design: Gateway
  • Aggregator is gateway that combines several messages into one internal action
design router
Design: Router
  • Routes a message from a source to a destination




design router1
Design: Router
  • Several type of routers
    • Splitters


  • Aggregators


  • Filters




design router2







Design: Router
  • And content-based routers
design pub sub
Design: Pub/Sub
  • Publication and Subscription
  • Message pattern
    • One message to subscribe
    • One to many messages publishing event information
  • Observer pattern over a distributed system
design pub sub1
Design: Pub/Sub
  • More on pub/sub





design pub sub2
Design: Pub/Sub
  • Two models for getting event data
    • Push – notification includes data
    • Pull – subscriber sends a request for the subscription data after receiving the event
  • Push is usually best for Web services
  • Pull is good when subscribers may not be interested in the data and the data is large or processor intensive
design reliability
Design: Reliability
  • Strongest and most resilient systems implement reliable messaging
  • Reliable messaging requires:
    • Idempotent processing
    • Durable storage



design dialogs and queues
Design: Dialogs and Queues
  • Dialogs are virtual connections between two nodes
  • With the help of queues, dialogs can be reliable and persistent across system resets
design dialogs and queues1
Design: Dialogs and Queues
  • More on dialogs and queues



design long running operations
Design: Long-Running Operations
  • Long-running operations
    • A key gain of messaging
    • Allows closer modeling of real-life business scenarios
  • Examples
    • User interaction is needed
    • Batch processing across multiple nodes
design long running operations1
Design: Long-Running Operations
  • Example






design guidelines
Design Guidelines
  • Avoid RPC and CRUD designs
    • Tends to encourage RPC like behavior
    • Interface may imply stateful interactions like enumeration
    • Interface is likely to be overly chatty
  • Don’t be too loose or extensible
    • Focus on encapsulating business processes
    • Use contracts to reduce coupling
session summary
Session Summary
  • Messaging allows for apps that more closely match business processes
  • Applications that use messaging are more closely matched with business processes
  • Existing technology can be used to support messaging
  • WSE 2.0 provides extensible messaging with web services across multiple protocols
call to action
Call to Action
  • Start designing with messaging in mind
  • Download WSE 2.0 Service Pack 1
  • Download the Hands-On Labs on WSE Messaging from Aaron Skonnard
for more information
For More Information
  • Blogs
    • Rebecca Dias WSE Product Manager
    • Hervey Wilson Lead Developer WSE
  • Newsgroup
    • microsoft.public.dotnet.framework.webservices.enhancements
  • Books
    • Enterprise Integration Patterns – Gregor Hohpe and Bobby Woolf