What is DataContract and ServiceContract?Explain

Answer Posted / sandeep

Service Contract:
Service contracts describe the operation that service can
provide. For Eg, a Service provide to know the temperature
of the city based on the zip code, this service is called as
Service contract. It will be created using Service and
Operational Contract attribute.

Data Contract:

Data contract describes the custom data type which is
exposed to the client. This defines the data types, that are
passed to and from service. Data types like int, string are
identified by the client because it is already mention in
XML schema definition language document, but custom created
class or data types cannot be identified by the client e.g.
Employee data type. By using DataContract we can make client
to be aware of Employee data type that are returning or
passing parameter to the method.

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

explain what is the difference wcf and web services? : Wcf data services

457


What is the address formats of the wcf transport schemas?

452


How many Instance modes is supported by WCF?

481


What are the different bindings supported by wcf?

454


explain wcf federated ws binding type? : Wcf data services

420






What is the service?

452


What is callback mode in wcf? Explain.

461


explain what is transport and message reliability? : Wcf data services

462


What is purpose of IsWrapped property in Message Contract in WCF?

471


Explain about msmq integration binding?

453


Explain briefly different instance modes in wcf?

456


tell me what was the code name for wcf? : Wcf data services

417


What is callback mode in wcf?

467


What is difference between wpf and wcf?

412


What is address header in wcf?

618