Outils pour utilisateurs

Outils du site


Panneau latéral

Accueil

Select other language :


Apprentissage

Enseignements

Enseignements Département Informatique SI5 et Master IFI

Enseignements Département Bâtiment Polytech'Nice

Autres Formations française et étrangère

Activités administratives, Ingénierie et Innovation Pédagogiques

Apprentissage Département Informatique SI5/Master 2 ingénierie informatique EUR DS4H


Recherche

Valorisation de la Recherche

Dépôts Logiciels à l’Agence de Protection des Programme (APP)

Valorisation des résultats de recherche et transfert

Diffusion de la Culture scientifique et Technologique

Communications de presse

Séminaire ENSI Tunis

Pédagogie Innovante

Relations industrielles et socio-économique

Organisation de Manifestations

  • Conférence sur les FabLabs, Alexandre Schneider, Professeur Agrégé en Génie Mécanique, Université de Reims Champagne-Ardenne Web
  • Journées UbiMob'14 Site Web

Animation de la Recherche

U-Santé

Privé

Outils

Sources d'Informations

cours:app_rep_orientees_service_2016_2017:lab_contract

Ceci est une ancienne révision du document !


Contracts in WCF

A contract is an agreement between two parties. It defines how a client should communicate with your service. In other words a contract is a platform and standard way of describing what the service does. There are the following four types of contracts in WCF Service Contract :

  • Service contract
  • Data Contract
  • Operation Contract
  • Fault Contract
  • Message Contract

we've already used Data Contract and Operation Contract.

Service contract and Operation Contract
Data Contract
Operation Contract
Fault Contract

In WCF (Windows Communication Foundation), we will not expose exception directly to client if it occurs at service level. Fault Contract is used to return error details to the other party i.e. client.

Message Contract

DataContract has limited control over the SOAP message and all that control is related to contents inside body of the SOAP message. But there are scenarios, when we need more control over SOAP message. So, MessageContract is the answer in such cases.

Tutorial

Exercice on Fault Contract

Create a simple calculator service with Add operation which throw general exception and send exception information from service to client with FaultException.

Follow this tutorial for more details

Exercice on Message Contract

cours/app_rep_orientees_service_2016_2017/lab_contract.1556057896.txt.gz · Dernière modification: 2019/04/24 00:18 par tigli