cours:app_rep_orientees_service_2016_2017:lab_contract
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_contract [2019/04/23 22:31] – [Tutorial] tigli | cours:app_rep_orientees_service_2016_2017:lab_contract [2019/04/24 05:57] (Version actuelle) – [References] tigli | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
+ | |||
+ | ==== Few reminders about WCF ABC Model ==== | ||
+ | |||
+ | The ABC of Windows Communication Foundation | ||
+ | |||
+ | " | ||
+ | |||
+ | * " | ||
+ | * " | ||
+ | * " | ||
+ | |||
+ | Web services zealots who read Web Service Description Language (WSDL) descriptions at the breakfast table will easily recognize these three concepts as the three levels of abstraction expressed in WSDL. So if you live in a world full of angle brackets, you can look at it this way: | ||
+ | |||
+ | * " | ||
+ | * " | ||
+ | * " | ||
+ | |||
+ | " | ||
+ | |||
+ | * You define a contract and implement it on a service | ||
+ | * 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. | ||
===== Contracts in WCF ===== | ===== Contracts in WCF ===== | ||
Ligne 14: | Ligne 36: | ||
== Service contract and Operation Contract == | == Service contract and Operation Contract == | ||
- | [[http:// | ||
- | == Data Contract == | + | Service contracts define the Interface |
- | [[http:// | + | |
- | == Operation Contract | + | An Operation Contract |
+ | [[http:// | ||
+ | == Data Contract == | ||
+ | Data Contracts define the data type for variables that are the same as get and set properties but the difference is that a Data Contract in WCF is used to serialize and deserialize the complex data. It defines how data types are serialized and deserialized. Using serialization, | ||
+ | |||
+ | [[http:// | ||
== Fault Contract == | == Fault Contract == | ||
||| | ||| | ||
- | In WCF (Windows Communication Foundation), we will not expose | + | A Fault Contract handles the exception and understands the cause of the error that occurs in the WCF service. When we develop a managed application or service, we will handle the exception |
+ | |||
+ | [[http:// | ||
== Message Contract == | == Message Contract == | ||
- | DataContract has limited control over the SOAP message | + | The default |
+ | ==== Exercices on Contracts ==== | ||
- | ==== Tutorial ==== | + | === Exercice on DataContract, |
+ | Create a calculator service that implement add and sub operations on complex numbers instead of numerical ones. | ||
+ | This justifies to introduce DataContract for the Complex number Type. | ||
=== Exercice on Fault Contract === | === Exercice on Fault Contract === | ||
- | Create a simple calculator service with Add operation | + | In the Add operation, throw general exception and send exception information from service to client with FaultException. |
- | [[http:// | ||
- | === Exercice on Message Contract === | ||
- | [[http:// | ||
- | ==== References ==== | ||
- | [[https:// |
cours/app_rep_orientees_service_2016_2017/lab_contract.1556058704.txt.gz · Dernière modification : 2019/04/23 22:31 de tigli