Supporting Offline Application Mode With WCF

100 %
0 %
Information about Supporting Offline Application Mode With WCF

Published on June 19, 2007

Author: Mentor


Supporting Offline Application Mode with WCF:  Supporting Offline Application Mode with WCF Tom Fuller, MVP MCSD.NET Microsoft MVP – Solution Architect President of Tampa Bay IASA Founder of Duration: 60 Minutes Getting To Know Me:  Getting To Know Me Professional Experience Community Involvement Published Work Presentation 411:  Our Objective Understand the terms and technologies for supporting offline mode Learn what WS-RM and System.Messaging provide See examples of how WCF can implement offline mode capabilities See other existing techniques and future enhancements that will support offline mode Presentation 411 The Foundations:  Sections What is a Smart Client anyway? Architecting for Better UX Basic Design Concepts (Replicate vs. Push vs. Pull vs. Callback) Doing Async the 'Right-Way' The Foundations What is a “Smart” Client anyway?:  Smart Client Checklist Must be capable of making use of peripherals Must have some type of external dependency Automatic installation and updating Device/Platform flexibility Controlled privilege on target platform Must be capable of supporting offline mode What is a 'Smart' Client anyway? Architecting for Better UX:  Why do we care about this Users demand better experiences Your applications will find new environments Only if they have flexibility I still like my thin clients and I think AJAX is really cool Even with AJAX there are things you can not do Architecting for Better UX What is a “Smart” Client anyway?:  When is offline mode appropriate Operations should be replayable Single service requests Data dependencies should be minimized Keep these types of services explicit What is a 'Smart' Client anyway? Basic Design Concepts:  Common design elements A persistence strategy A correlation strategy Manager/dispatcher capabilities Transport resiliency Failover to offline (optional) Basic Design Concepts Basic Design Concepts:  Understanding the Replication Model Basic Design Concepts Basic Design Concepts:  Understanding the Push Model Basic Design Concepts Basic Design Concepts:  Understanding the Pull Model Basic Design Concepts Basic Design Concepts:  Understanding the Callback Model Basic Design Concepts Doing Async The “Right-Way”:  Partial Async Programming Model Begin/End Check back later Reporting dashboards Scheduled jobs Ping until your done Very chatty but effective Doing Async The 'Right-Way' WS-RM / System.Messaging:  Sections What does WS-RM do? An MSMQ Primer System.Messaging basics Advanced messaging topics WS-RM / System.Messaging What does WS-RM do?:  WS-ReliableMessaging Like any WS* spec these are implemented as a set of SOAP Headers Meant to facilitate replay, ordering, and duplication detection of messages Four basic 'Assurances' AtMostOnce AtLeastOnce ExactlyOnce InOrder Allows for 'conversations' between client/service What does WS-RM do? An Example Conversation:  An Example Conversation WS-RM in WCF:  So what does this mean for me? If you can communicate in a reliable way you may not need offline capability 'TCP at the SOAP level' (courtesy of Shy Cohen) Probably not the best thing to use in a truly disconnected mode application Only meant for small temporary outages that would impact the integrity of a series of messages WS-RM in WCF An MSMQ Primer:  Message Queuing (MSMQ) It’s part of the platform! This technology is what truly adds resiliency to an application Support on Windows XP/Win 2K3 (MSMQ 3) and Windows Vista (MSMQ 4) Types of queues: Private (\private$), Public (in AD), Outgoing, Admin, Response, Dead-Letter, Poison, Sub (only in 4.0), Journal, and Report Has transactional capability Define triggers for asynchronous processing (COM Interop) An MSMQ Primer An MSMQ Primer:  An MSMQ Primer MSMQ in the Enterprise:  Can it scale? Deploy it to a clustered set of servers Is it secure? You can use HTTPs Access control capable What about performance? Reports against IBM MQSeries As is the case with most scalability models with Microsoft … add more servers (scale horizontally) MSMQ in the Enterprise System.Messaging Basics:  API for MSMQ Main class 'MessageQueue' Able to create a queue, read, write Able to enlist in dtc transactions New in .NET 2.0 Quick lookupid Integrated with System.Transactions New native MSMQ cursor Programmatic control over multi-cast addresssing System.Messaging Basics An MSMQ Primer:  Demo 1 System.Messaging, MSMQ 4.0 An MSMQ Primer Advanced Messaging Topics:  Tuning for high performance Turn off Exactly Once, transacted batching, Use non-transactional and set Durable to false Poison Message Handling MSMQ 4 has a much better approach for this Integration MSMQ – MQSeries Bridge Design considerations Correlation Durability Recoverable Messages Advanced Messaging Topics Application Offline Mode in WCF:  Sections Understanding the Bindings Message Exchange Patterns (MEP) Explanation of message integration Full Demo Application Offline Mode in WCF Understanding the Bindings:  The anatomy of a binding This is 'How' your service is supposed to communicate The binding elements are the key building block Order is important! It’s not complicated, just think about it as a pipeline Understanding the Bindings Understanding the Bindings:  netMsmqBinding Extends the MSMQBindingBase Understanding the Bindings andlt;netMsmqBindingandgt; andlt;binding name='UpdateCustomerDetail' closeTimeout='00:01:00' openTimeout='00:01:00' receiveTimeout='00:10:00' sendTimeout='00:01:00' deadLetterQueue='System' durable='true' exactlyOnce='true' maxReceivedMessageSize='65536' maxRetryCycles='2' receiveRetryCount='5' retryCycleDelay='00:30:00' timeToLive='1.00:00:00' useSourceJournal='false' andgt; andlt;readerQuotas maxDepth='32' /andgt; andlt;security mode='None'andgt; andlt;transport msmqAuthenticationMode='WindowsDomain' msmqEncryptionAlgorithm='RC4Stream' msmqProtectionLevel='Sign' msmqSecureHashAlgorithm='Sha1' /andgt; andlt;message clientCredentialType='Windows' /andgt; andlt;/securityandgt; andlt;/bindingandgt; andlt;/netMsmqBindingandgt; Understanding the Bindings:  netMsmqBindingElement Collection Understanding the Bindings Using One-Way Invocation:  Contract definition Remember, netMsmqBinding only supports one-way ServiceContract/OperationContract Using One-Way Invocation [ServiceContract] class UpdateCustomerDetail { [OperationContract(IsOneWay=true)] void UpdateCustomer(UpdateCustomerDetailRequest req) { //TODO: Implementation here } } Understanding the Bindings:  MsmqIntegrationBinding Lives in another namespace System.ServiceModel.MsmqIntegration Extends the same base class MsmqBindingBase MSMQ Message andlt;andgt; WCF Message There are many differences when you look at the binding code No message security Limited contract flexibility No message encoder Intended for already existing MSMQ applications Understanding the Bindings Understanding the Bindings:  MsmqIntegrationBindingElement Collection Understanding the Bindings An MSMQ Primer:  Demo 2 WCF Using netMsmqBinding An MSMQ Primer Other Techniques / Futures:  Sections Smart Client Offline Application Block What’s new in Vista / MSMQ 4.0 Possible marriage of WS-RM / MSMQ What about Mobile / Compact Framework Other Techniques / Futures Smart Client Offline Application Block:  High Level Architecture Scenarios where you would use this over WCF Smart Client Offline Application Block What’s New in Vista / MSMQ 4.0:  A whole new version of MSMQ Poison message handling Distributed Transacted reads Subqueues Application specific dead-letter queues How about the combination of WCF/WF via MSMQ (DinnerNow.Net) What’s New in Vista / MSMQ 4.0 Possible Marriage of WS-RM and MSMQ:  There are obvious overlaps If you want the time independence but don’t care about the loose coupling at the message level Having both would be very powerful You kind of have some of it today Batched transactions Exactly once delivery Possible Marriage of WS-RM and MSMQ What about Mobile / Compact Framework:  Planning is underway for WCF with queued transport on the handheld. Will not likely contain the full ServiceModel Initial POC using email as the transport MSMQ is supported What about Mobile / Compact Framework Resources:  David Hill’s Blog: WS-ReliableMessaging Specification Index Page: WS-ReliableMessaging spec: Smart Client Offline Application Block: WCF Architecture Overview: Nick Allen’s (Dr. Nick) Blog: Contact me –, Resources

Add a comment

Related presentations

Related pages

Chapter 5: Authentication, Authorization, and Identities ...

Because WCF authentication options depend on the transfer security mode being used, ... or in Active Directory Application Mode (ADAM), ...
Read more

What is the most efficient architecture to support offline ...

... app in order to support offline mode. ... is supporting your scenario. It ... Lasker's Offline Silverlight Applications presentation from Tech Ed ...
Read more

Hosting Services

This hosting option consists of registering the application domain (AppDomain) that hosts an WCF service as a managed Windows Service (formerly known as NT ...
Read more

Wcf Http and Https - Stack Overflow

Wcf Http and Https. ... I did change the security mode to Transport when I set up for Https but I did not change it ... for supporting both HTTP and HTTPS. 2
Read more

WCF and Intermediate Devices - Distributed Services ...

WCF and Intermediate Devices ... Using an intermediate device with a WCF client/service application can ... Message Security and Mixed-Mode ...
Read more

Java client for WCF service with wsHttpBinding over SSL ...

... (Mode=TransportWithMessageCredential) ... for the application message. But WCF reject the message ... Symmetric endorsing supporting
Read more

Hosting WCF Services - CODE Online

... services for offline work, and consuming remote WCF services ... hosting mode restricts an application to ... supporting WCF hosting with ...
Read more - Supporting both Mtom and Text as MessageEncoding ...

Supporting both Mtom and Text as ... type="application/xop ... How to load raw SOAP message from file and trying to send via WCF with MTOM encoding?
Read more