WCF series courses

Source: Internet
Author: User
Tags msmq

According to Microsoft's official explanation, WCF (formerly called "Indigo") is a unified framework for building and running service-oriented applications using managed code. It enables developers to build a secure, trusted, and transactional solution across platforms, and to be compatible with existing systems. WCF is a set of developers for Microsoft Distributed Application Development. It integrates all technologies related to distributed systems on the. NET platform, such as. Net remoting, asmx, WSE, and MSMQ. In terms of the scope of communication (communiation), it can be cross-process, cross-machine, cross-subnet, enterprise network, or Internet; in terms of host programs, it can be ASP. net, EXE, WPF, Windows Forms, NT Service, COM + as the host (host ). The protocols supported by WCF include TCP, HTTP, cross-process, and custom. Security modes include SAML, Kerberos, X509, user/password, and custom. That is to say, it is easy to develop a SOA-based Distributed System under the WCF framework. Microsoft includes all the technical elements related to this, and has mastered the concept, it is equivalent to mastering the key to open the SOA door.
WCF is built on. NET Framework 2.0. The official version should be release as the core part of Windows Vista. However, this does not mean that WCF can only run under Windows Vista. If winfx runtime components is installed, it can still be used in Windows XP and Windows 2003 operating systems. Visual Studio 2005 does not contain WCF. However, after winfx runtime components is installed, you can develop and create a WCF program in Visual Studio 2005.
Currently the latest WCF version is February 2006 CTP, download page is: http://www.microsoft.com/downloads/details.aspx? Familyid = F51C4D96-9AEA-474F-86D3-172BFA3B828B &; displaylang = en. Use wcf.exe to use a few related tools, such as svcutil.exe, so you also need to download the winfx runtime components SDK, its download page is: http://www.microsoft.com/downloads/details.aspx? Familyid = 9be1fc7f-0542-47f1-88dd-61e3ef88c402 &; displaylang = en. You can select Network or local installation to install the SDK. For local installation, the file size is about 1 GB, which is an ISO file. After the SDK is installed, there is a Microsoft SDK directory under the Program Files directory.
WCF is Microsoft's key product, so it also launched a special official website (http://windowscommunication.net), the site has the latest WCF news release, as well as introduction to the WCF technical documentation and sample code.
Ii. Benefits of WCF
In the article introducing windows Communication Foundation prepared by David Chappell, a fresh example is provided to illustrate the advantages of WCF. Suppose we want to develop a new application for a car rental company for Car Rental booking service. The taxi booking service will be accessed by a variety of applications, including call center, J2EE-based taxi booking service and partner application ),:
From a functional perspective, WCF can be regarded as a union of asmx,. Net remoting, Enterprise Service, WSE, MSMQ, and other technologies. (Note: This statement only applies to functions. In fact, WCF is far from simple union. It is a service-oriented product and has changed the normal development mode .) Therefore, for the above example of the Auto Booking Service System, the use of WCF can meet the needs of security, trustworthiness, interoperability, cross-platform communication, and so on. Developers no longer need to learn about. Net remoting, asmx, and other technologies separately.
In summary, WCF has the following advantages:
1. Uniformity
As described above, WCF is an integration of asmx,. Net remoting, Enterprise Service, WSE, MSMQ, and other technologies. Since WCF is fully written by the managed code, developing the WCF application and developing other.. NET applications do not have much difference. We can still use WCF to create service-oriented applications like creating object-oriented applications. Http://wayfarer.cnblogs.com/images/cnblogs_com/wayfarer/wcf/wcf01.gif
Http://wayfarer.cnblogs.com/images/cnblogs_com/wayfarer/wcf/wcf03.gif 2. Interoperability
Since the most basic communication mechanism of WCF is soap, this ensures the interoperability between systems, even when different contexts are run. This communication can be Based on. NET to. net, as shown in:
Cross-process, cross-machine, or cross-platform communication is supported as long as standard web services such as J2EE application servers (such as WebSphere and WebLogic) are supported ). Applications can run in Windows or other operating systems, such as Sun Solaris, hp unix, and Linux. As shown in:
3. Security and trustworthiness
WS-Security, WS-trust, and WS-secureconversation are added to soap messages for user authentication, data integrity verification, data privacy, and other security factors.
WS-reliablemessaging is added to the SOAP header to allow trusted end-to-end communication. The soap-based information exchange based on WS-coordination and WS-atomictransaction supports two-phase commit transactions ). The various WS-policies mentioned in the http://wayfarer.cnblogs.com/images/cnblogs_com/wayfarer/wcf/wcf04.gif are supported in WCF. For messaging, soap is the basic protocol of Web Service. It contains the header and body ). In the message header, WS-Addressing is defined to locate the address information of the SOAP message, and MTOM (message transmission optimization mechanism, message transmission optimization mechanism) is also included ). : Http://wayfarer.cnblogs.com/images/cnblogs_com/wayfarer/wcf/wcf05.gif
4. Compatibility
WCF fully considers compatibility with old systems. Installing WCF does not affect existing technologies such as asmx and. Net remoting. Even though both of them use soap, applications developed based on WCF can still directly interact with asmx.

> [Original] My WCF journey (1): create a simple WCF Program (artech)

> [Original] My WCF journey (2): endpoint Overview (artech)

> [Original] My WCF journey (3): Implement bi-ctional al communication (artech) in WCF)

> [Original] My WCF journey (4): serialization in WCF-Part I (artech)

> [Original] My WCF journey (4): serialization in WCF-Part II (artech)

> [Original] My WCF journey (5): A combination of Service-Oriented Architecture (SOA) and Object-Oriented Programming (OOP) -- How to Implement overloading of service contract) (artech)

> [Original] My WCF journey (6): Why timeoutexception occurs when duplex service is called in winform application (artech)

> [Original] My WCF journey (7): A combination of Service-Oriented Architecture (SOA) and Object-Oriented Programming (OOP) -- How to Implement the inheritance of service contract (artech)

> [Original] My WCF journey (8): Session and instancing Management (artech) in WCF)

> [Original] My WCF journey (9): How to Use tcptrace in WCF for soap trace (artech)

> [Original] My WCF journey (10): How to perform Exception Handling (artech) in WCF)

> [Original] My WCF journey (11): Let's talk about two-way communication in WCF-HTTP-based two-way communication v. S. TCP-based two-way communication (artech)

> [Original] My WCF journey (12): Using MSMQ for reliable messaging (artech)

> [Original] My WCF journey (13): Creating MSMQ-based Responsive Service (artech)

From: http://www.cnblogs.com/series/3/

======================================

Index of a series of articles from theory to practice in WCF

From theory to practice (1): unveil the secrets

From theory to practice in WCF (2): a decisive battle

From theory to practice in WCF (3): black contract in the No. 8 pawnshop

From theory to practice (4): Where is the path

From theory to practice (5): detailed explanation of binding

From theory to practice (6): WCF Architecture

From theory to practice (7): message exchange mode

From theory to practice (8): event broadcast

From theory to practice (9): instance mode and object Lifecycle

From theory to practice (10): Exception Handling

From theory to practice (11)-asynchronous

From theory to practice (12): transactions

From theory to practice in WCF (13): Transaction Voting

From theory to practice (14): WCF solution Template

From theory to practice (15): responding to changes

From theory to practice (16): heavy-load operations (with video + PPT + Source Code)

From theory to practice in WCF (17): large deviation from Oo (with video + PPT + Source Code)

Via: http://kb.cnblogs.com/list/43708/

 

==========================================

Getting started with WCF on msdn

This section describes how to: Define a Windows Communication Foundation Service Agreement
Describes how to use a user-defined interface to create a WCF protocol. Agreements are used to define the functions provided by a service to the outside world and describe how to communicate with potential users. How to: implement the Windows Communication Foundation Service Agreement
Describes how to implement a service agreement. After creating an agreement, you must implement the functions provided by the Service in a class inherited from the interface of the definition agreement. How to: Host and run Basic Windows Communication Foundation services
Describes how to configure the service endpoint in the code, and how to host and start the service in the console application. To activate the service, you must configure and host the service in the runtime environment. This environment creates a service and controls its context and lifecycle. How to: create a Windows Communication Foundation Client
Describes how to retrieve metadata used to create a WCF client from the WCF Service. This process uses servicemodel metadata utility tool (svcutil.exe) provided by WCF ). How to: configure the Basic Windows Communication Foundation Client
Describes how to configure the basic client created using servicemodel metadata utility tool (svcutil.exe. To configure the client, you must specify the endpoint used by the client to access the service. How to: Use the Windows Communication Foundation Client
Describes how to use the WCF client proxy generated by servicemodel metadata utility tool (svcutil.exe) to call the functions provided by the Service.

Link: http://msdn.microsoft.com/zh-cn/library/ms734712.aspx

 

======================================

[Download source code]

Convert from zero to an index of a WCF series of articles

Author: webabcd

Introduction
WCF (Windows Communication Foundation): contract, binding, host, exception handling, asynchronous calling, bidirectional communication, MTOM, stream data transmission, serialization, instance model, session Status, concurrency, throttling, transaction, security, reliability message, message queue, create rest in WCF, Ajax call WCF

1. convert it to the entire WCF (1)-it cannot be vulgar. I also started from Hello.
Introduction
I don't want to talk nonsense, and I can't avoid it. I also started from Hello.

2. Convert from zero to a whole WCF (2)-contract Contract (servicecontract, operationcontract, datacontract, serviceknowntype, and datamember)
Introduction
Servicecontract, operationcontract, datacontract, serviceknowntype, and datamember ).

3. convert to the entire WCF (3)-bind binding (basichttpbinding and nettcpbinding)
Introduction
HTTP uses basichttpbinding as an example. TCP uses nettcpbinding as an example.

4. convert to the entire WCF (4)-Exception Handling (exception, faultexception, faultexception, ierrorhandler)
Introduction
Generally, Exception Processing, faultexception and faultexception are thrown and processed, and ierrorhandler is used to handle exceptions.

5. convert to the entire WCF (5)-host hosting (host in IIS, application, was, windowsservice)
Introduction
The WCF Service can host IIS, application, was, and windowsservice. This article takes the host in Windows service as an example.

6. convert to the entire WCF (6)-Message Processing (asynchronous oneway call, duplex two-way communication)
Introduction
The isoneway parameter of the operation contract is used to Implement Asynchronous calls. Two-way communication based on HTTP, TCP, named pipe, and MSMQ is implemented.

7. Convert from zero to zero: WCF (7)-Message Processing (message transmission optimization mechanism-MTOM)
Introduction
Message transmission optimization (MTOM. This document uses Web upload as an example.

8. convert it to the entire WCF (8)-Message Processing (using streaming data transmission files)
Introduction
Use streaming data to transfer files to reduce memory overhead.

9. convert it to a whole WCF (9)-serialization (datacontractserializer, xmlserializer, datacontractjsonserializer, soapformatter, binaryformatter)
Introduction
This document uses datacontractserializer, xmlserializer, datacontractjsonserializer, soapformatter, and binaryformatter as examples.

10. convert it to the entire WCF (10)-instance model (instancecontextmode)
Introduction
Servicebehavior
Instancecontextmode. percall-the new system. servicemodel. instancecontext object is created before each call and recycled after each call.
Instancecontextmode. persession-creates a new system. servicemodel. instancecontext object for each session.
Instancecontextmode. Single-only one system. servicemodel. instancecontext object is used for all incoming calls and will not be recycled after the call. If the service object does not exist, create one.

11. convert it to the entire WCF (11)-session state (session)
Introduction
Servicecontract
Sessionmode. Allowed-specify that the Protocol also supports sessions when session binding is passed in (default)
Sessionmode. required-specify that the Protocol requires session binding. If the binding is not configured to support sessions, an exception is thrown.
Sessionmode. notallowed-specify that the Protocol never supports session binding.
Operationcontract
Isinitiating-gets or sets a value that indicates whether the method can start a session (if any) on the server.
Isterminating-gets or sets a value that indicates whether the server closes the session after a service operation sends a reply message (if any.

12. convert to the entire WCF (12)-concurrency and throttling (concurrent and throttle)
Introduction
Concurrencymode. Single: Single-thread concurrency mode. The system automatically locks and has no concurrency issues.
Concurrencymode. reentrant: reentrant single-thread concurrency mode. This mode takes effect only when the reentrant (callback) operation is available. The thread returned from the callback enters the queue tail queue.
Concurrencymode. Multiple: multi-thread concurrency mode. The system does not automatically lock the lock, and there is a concurrency problem.
WCF (Windows Communication Foundation)-throttle ):
Maxconcurrentcils-Maximum number of active messages in the service at the same time. The default value is 16.
Maxconcurrentinstances-the maximum number of service instances that exist simultaneously in the service. The default value is int32.maxvalue.
Maxconcurrentsessions-the maximum number of sessions that exist simultaneously in the service. The default value is 10.

13. Convert from zero to a full WCF (13)-concurrency control (LOCK) (mutex, semaphore, monitor, lock, threadpool, interlocked, readerwriterlock)
Introduction
In concurrencymode. multiple concurrency mode and instancecontextmode. the Single Instance model is used as an example (concurrency problems exist at this time). This section describes how to implement concurrency control, that is, the use of various locks (mutex, semaphore, monitor, lock, threadpool, interlocked, readerwriterlock)

14. Convert from zero to a whole WCF (14)-transaction)
Introduction
Use the transactionflowattrioption Declaration (set the transactionflowoption parameter) on the contract method to specify the transaction flow policy of the service operation.
The service method is declared with operationbehaviorattribute (sets the transactionscoperequired parameter) to specify whether the method is executed within the transaction scope.
Configure the transactionflow attribute of the binding node of the host and client to specify whether the binding supports stream transactions.

15. Convert from zero to WCF (15)-reliablemessaging)
Introduction
The retry method ensures reliable message transmission. The default value is 8.
When "ordered transmission" is configured, the client and server will open up a buffer. After receiving messages from all clients, the Server Buffer will sort messages in the order called by the client, then, the server is called in an orderly manner.

16. convert it to the entire WCF (16)-Message Queue (MSMQ-Microsoft Message Queue)
Introduction
The binding attribute configuration of netmsmqbinding is as follows:
Exactlyonce-ensure that messages are delivered only once
Durable-message persistence required
Timetolive-the time when the message expires and is moved from the original queue to the dead Message Queue
Receiveretrycount-Maximum number of attempts to send a message before transmitting it to the retry queue
Maxretrycycles-Maximum number of retry cycles
Retrycycledelay-latency between retry cycles
Receiveerrorhandling-specifies how to handle error messages
Deadletterqueue-specifies the type of the dead message queue used
Customdeadletterqueue-Uri of the local custom dead Message Queue

17. convert it to the entire WCF (17)-Security)
Introduction
This document uses the username and password for verification and uses the X.509 Certificate for encryption.

18. Convert from zero to a whole WCF (18)-web programming model (create rest for WCF and call WCF through Ajax)
Introduction
Use WCF to create a rest service and use Asp.net ajax to call the WCF Service
System. servicemodel. Activation. webservicehostfactory-used to host services that use the WCF Web Programming Model
System. servicemodel. Activation. webscriptservicehostfactory-automatically add ASP. NET Ajax endpoints to the service without configuration.

OK
[Download source code]

============================

WCF Technical Analysis Series:

One of the analysis of WCF technology: Simulate the WCF infrastructure through an ASP. NET Program
WCF Technical Analysis 2: IIS and ASP. NET Pipelines
WCF Technology Analysis 3: How to host non-HTTP-based IIS services
WCF Technology Analysis 4: Secrets of IIS-based WCF Service hosting
5: use ASP. NET compatibility mode to create a session-supported WCF Service
WCF Technology Analysis 6: Why is the baseaddress configured in the ASP. NET-based application hosting invalid?
7: how to integrate WCF with enterlib piab and unity
Analysis of WCF Technology 8: The Caching mechanism of channelfactory in clientbase <t>
Technical Analysis of WCF 9: what are the consequences of Service proxy failure to be closed in time?
10: how to handle exceptions on clients that call the WCF Service

11: Application of asynchronous operations in WCF (Part 1)
11: Application of asynchronous operations in WCF (Part II)
12: Data contract and datacontractserializer)
Session 13: known type)
MySQL: Generic Data contracts and collective data contracts (Part 1)
MySQL: Generic Data contracts and collective data contracts (Part II)
Step 15 of WCF Technology Analysis: Role of datacontractsurrogate in serialization
WCF Technology Analysis 16: Data contract equivalence and Version Control

 

From: http://hi.baidu.com/freezesoul/blog/item/4555357a7fa2e7e92e73b30d.html

 

Here I will add a series

WCF series (9)-WCF Security Series (4)-Transport Security Mode for wshttpbinding-WCF Security Series (8)-WCF Security Series (3) -Message security mode for binding nettcpbinding-WCF series (7)-WCF Security Series (2)-Transport Security Mode for binding nettcpbinding-WCF Security Series (6)-WCF Security Series (1) -basichttpbindingwcf series (v) -- serialization (ii) WCF series (iv) -- serialization (I) WCF series (iii) -- Annotation of the WCF configuration file (II) -- use a configuration file to build and use the WCF series of the WCF Service (1) -- do not use a configuration file to build and use the WCF Service Additional:WCF series _ distributed transactions (bottom) WCF series _ distributed transactions (top)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.