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/24 05:36] – [Tutorial] tigli | cours:app_rep_orientees_service_2016_2017:lab_contract [2019/04/24 05:57] (Version actuelle) – [References] tigli | ||
|---|---|---|---|
| Ligne 36: | 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 ==== | ==== Exercices on Contracts ==== | ||
| + | |||
| + | === 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.1556084188.txt.gz · Dernière modification : 2019/04/24 05:36 de tigli
                
                