cours:app_rep_orientees_service_2016_2017:lab_abc
Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
cours:app_rep_orientees_service_2016_2017:lab_abc [2018/03/28 19:47] – [Creation of various endpoints in configuration] tigli | cours:app_rep_orientees_service_2016_2017:lab_abc [2019/04/24 05:33] (Version actuelle) – [Introduction] tigli | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
- | ==== Introduction | + | ==== Few reminders about WCF ABC Model ==== |
The ABC of Windows Communication Foundation | The ABC of Windows Communication Foundation | ||
Ligne 22: | Ligne 22: | ||
* 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 ==== | ||
- | ==== Creation | + | 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. |
- | 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. This topic shows how to add endpoints using a configuration file that contain both relative and absolute addresses. | + | A binding has the following characteristics: |
- | == question 1 : Adresses == | + | * Transport: Defines |
- | ||| | + | * Encoding |
- | * Take the calculator Web service (with and add and sub between two value) | + | |
- | * Add various endpoints | + | |
- | * To test them write a graphical client that propose add and sub operations | + | |
- | ** Comments : ** | + | - Text Encoding |
- | // When configuring a service in Visual Studio, use either a Web.config file or an App.config file to specify the settings. The choice of the configuration file name is determined by the hosting environment you choose for the service. If you are using IIS to host your service, use a Web.config file. If you are using any other hosting environment, | + | - 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. | ||
- | //Use the Configuration Editor Tool in Visual Studio(or SvcConfigEditor.exe)// | ||
- | == question 2 : Bindings | + | ==== Types of Binding ==== |
- | ||| | + | |
- | * [[https:// | + | |
- | * Take the calculator Web service (with and add and sub between two value) | + | Some predefined bindings |
- | * Define two endpoints : one with basicHttpBinding and the other with wsHttpBinding | + | |
- | * What are the differences between both services now ? | + | |
- | * To test them write a graphical client that propose add and sub operations (two Buttons) between two values (two (TextBox)and that displays the result (Label), on the two endpoints. | + | |
- | == question 3 : Contracts | + | == BasicHttpBinding |
- | ||| | + | |
- | ** Fault Contract | + | *It is suitable for communicating with ASP.NET Web services (ASMX)-based services that comfort with WS-Basic Profile conformant Web services. |
+ | *This binding uses HTTP as the transport and text/XML as the default message encoding. | ||
+ | *Security is disabled by default | ||
+ | *This binding does not support WS-* functionalities like WS- Addressing, WS-Security, | ||
+ | *It is fairly weak on interoperability. | ||
- | In WCF (Windows Communication Foundation), | + | == WSHttpBinding == |
- | * Add to your calculator | + | |
- | | + | *It offers lot more functionality in the area of interoperability. |
- | | + | *It supports WS-* functionality and distributed transactions with reliable and secure sessions using SOAP security. |
- | * Add [FaultContract(typeof(CustomFaultDetails))]in your [Service Contract] | + | *It uses HTTP and HTTPS transport for communication. |
- | * and then use it in your code .. | + | |
- | | + | |
- | | + | == WSDualHttpBinding == |
- | | + | |
- | * // throw new FaultException(ex,“Reason: Testing…..“); // | + | This binding is same as that of WSHttpBinding, |
- | * Test it without Fault Contract | + | |
+ | In WSDualHttpBinding reliable sessions are enabled by default. It also supports communication via SOAP intermediaries. | ||
+ | |||
+ | == 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 | ||
+ | NetTcpBinding | ||
+ | |||
+ | 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 | ||
+ | |||
+ | == 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 | ||
+ | |||
+ | == NetMsmqBinding == | ||
+ | |||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | == NetPeerTcpBinding == | ||
+ | |||
+ | *This binding provides secure binding for peer-to-peer environment and network applications. | ||
+ | | ||
+ | *It provides full support for SOAP security, transaction and reliability. | ||
+ | |||
+ | ==== Exercice : Creation of various endpoints in configuration with different kinds of bindings ==== | ||
+ | |||
+ | Endpoints provide clients with access to the functionality a Windows Communication Foundation | ||
+ | |||
+ | |||
+ | |||
+ | * Take the calculator Web service | ||
+ | * Define two endpoints : one with basicHttpBinding and wsHttpBinding (two standard bindings for SOAP based web services) | ||
+ | * 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. | ||
- | ==== References ==== | ||
- | [[https:// |
cours/app_rep_orientees_service_2016_2017/lab_abc.1522266465.txt.gz · Dernière modification : 2018/03/28 19:47 de tigli