Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentes Révision précédente Prochaine révision | Révision précédente | ||
cours:app_rep_orientees_service_2016_2017:lab_abc [2019/04/24 00:41] tigli [Introduction] |
cours:app_rep_orientees_service_2016_2017:lab_abc [2019/04/24 07:33] (Version actuelle) tigli [Introduction] |
||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
- | ==== Introduction ==== | + | ==== Few reminders about WCF ABC Model ==== |
The ABC of Windows Communication Foundation | The ABC of Windows Communication Foundation | ||
Ligne 21: | Ligne 21: | ||
* You choose or define a service binding that selects a transport along with quality of service, security and other options | * You choose or define a service binding that selects a transport along with quality of service, security and other options | ||
* You deploy an endpoint for the contract by binding it (using the binding definition, hence the name) to a network address. | * You deploy an endpoint for the contract by binding it (using the binding definition, hence the name) to a network address. | ||
+ | |||
+ | ==== Binding ==== | ||
+ | |||
+ | Bindings are nothing but the transport protocols that are used for the communication with the client application. WCF provides a wide range of transport protocols that can be used as in the requirements. | ||
+ | |||
+ | A binding has the following characteristics: | ||
+ | |||
+ | * Transport: Defines the base protocol to be used, like HTTP, Named Pipes, TCP and MSMQ are some of the protocols. | ||
+ | * Encoding (Optional): Three types of encodings are available, they are: | ||
+ | |||
+ | - Text Encoding | ||
+ | - Binary Encoding | ||
+ | - Message Transmission Optimization Mechanism (MTOM) | ||
+ | |||
+ | * Protocol (Optional): Defines the information to be used in the binding such as Security, transaction or reliable messaging capability. | ||
+ | |||
==== Types of Binding ==== | ==== Types of Binding ==== | ||
- | Let us see more detailed on predefined binding | + | Some predefined bindings are : |
- | BasicHttpBinding | + | |
+ | == BasicHttpBinding == | ||
*It is suitable for communicating with ASP.NET Web services (ASMX)-based services that comfort with WS-Basic Profile conformant Web services. | *It is suitable for communicating with ASP.NET Web services (ASMX)-based services that comfort with WS-Basic Profile conformant Web services. | ||
Ligne 33: | Ligne 50: | ||
*It is fairly weak on interoperability. | *It is fairly weak on interoperability. | ||
- | WSHttpBinding | + | == WSHttpBinding == |
*Defines a secure, reliable, interoperable binding suitable for non-duplex service contracts. | *Defines a secure, reliable, interoperable binding suitable for non-duplex service contracts. | ||
Ligne 41: | Ligne 58: | ||
*Reliable sessions are disabled by default. | *Reliable sessions are disabled by default. | ||
- | WSDualHttpBinding | + | == WSDualHttpBinding == |
This binding is same as that of WSHttpBinding, except it supports duplex service. Duplex service is a service which uses duplex message pattern, which allows service to communicate with client via callback. | This binding is same as that of WSHttpBinding, except it supports duplex service. Duplex service is a service which uses duplex message pattern, which allows service to communicate with client via callback. | ||
In WSDualHttpBinding reliable sessions are enabled by default. It also supports communication via SOAP intermediaries. | In WSDualHttpBinding reliable sessions are enabled by default. It also supports communication via SOAP intermediaries. | ||
- | WSFederationHttpBinding | + | |
+ | == WSFederationHttpBinding == | ||
This binding support federated security. It helps implementing federation which is the ability to flow and share identities across multiple enterprises or trust domains for authentication and authorization. It supports WS-Federation protocol. | This binding support federated security. It helps implementing federation which is the ability to flow and share identities across multiple enterprises or trust domains for authentication and authorization. It supports WS-Federation protocol. | ||
Ligne 52: | Ligne 70: | ||
This binding provides secure and reliable binding environment for .Net to .Net cross machine communication. By default it creates communication stack using WS-ReliableMessaging protocol for reliability, TCP for message delivery and windows security for message and authentication at run time. It uses TCP protocol and provides support for security, transaction and reliability. | This binding provides secure and reliable binding environment for .Net to .Net cross machine communication. By default it creates communication stack using WS-ReliableMessaging protocol for reliability, TCP for message delivery and windows security for message and authentication at run time. It uses TCP protocol and provides support for security, transaction and reliability. | ||
- | NetNamedPipeBinding | + | |
+ | == NetNamedPipeBinding == | ||
This binding provides secure and reliable binding environment for on-machine cross process communication. It uses NamedPipe protocol and provides full support for SOAP security, transaction and reliability. By default it creates communication stack with WS-ReliableMessaging for reliability, transport security for transfer security, named pipes for message delivery and binary encoding. | This binding provides secure and reliable binding environment for on-machine cross process communication. It uses NamedPipe protocol and provides full support for SOAP security, transaction and reliability. By default it creates communication stack with WS-ReliableMessaging for reliability, transport security for transfer security, named pipes for message delivery and binary encoding. | ||
- | NetMsmqBinding | + | |
+ | == NetMsmqBinding == | ||
*This binding provides secure and reliable queued communication for cross-machine environment. | *This binding provides secure and reliable queued communication for cross-machine environment. | ||
Ligne 61: | Ligne 81: | ||
*It enables for disconnected operations, failure isolation and load leveling | *It enables for disconnected operations, failure isolation and load leveling | ||
- | NetPeerTcpBinding | + | == NetPeerTcpBinding == |
*This binding provides secure binding for peer-to-peer environment and network applications. | *This binding provides secure binding for peer-to-peer environment and network applications. | ||
Ligne 67: | Ligne 87: | ||
*It provides full support for SOAP security, transaction and reliability. | *It provides full support for SOAP security, transaction and reliability. | ||
- | ==== Creation of various endpoints in configuration ==== | + | ==== Exercice : Creation of various endpoints in configuration with different kinds of bindings ==== |
Endpoints provide clients with access to the functionality a Windows Communication Foundation (WCF) service offers. You can define one or more endpoints for a service by using a combination of relative and absolute endpoint addresses, or if you do not define any service endpoints, the runtime provides some by default for you. | Endpoints provide clients with access to the functionality a Windows Communication Foundation (WCF) service offers. You can define one or more endpoints for a service by using a combination of relative and absolute endpoint addresses, or if you do not define any service endpoints, the runtime provides some by default for you. | ||
- | == Tutorial on Bindings == | ||
- | ||| | ||
- | * [[https://docs.microsoft.com/en-us/dotnet/framework/misc/binding|Introduction to Bindings]] | ||
* Take the calculator Web service (with and add and sub between two value) | * Take the calculator Web service (with and add and sub between two value) | ||
- | * Define two endpoints : one with basicHttpBinding and the other with wsHttpBinding | + | * Define two endpoints : one with basicHttpBinding and wsHttpBinding (two standard bindings for SOAP based web services) |
* What are the differences between both services now ? | * What are the differences between both services now ? | ||
* To test them write a console or a graphical client that propose add and sub operations on the two endpoints. | * To test them write a console or a graphical client that propose add and sub operations on the two endpoints. | ||