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

What is the purpose of base address in wcf service? How it is specified?

464


Which bindings are used for metadata configuration in wcf?

439


Explain service contracts?

458


tell me what is proxy and how to generate proxy for wcf services? : Wcf data services

449


How to host WCF Self-Hosting?

516






How to set the instancing mode in wcf service?

493


Explain wcf contracts?

426


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

473


Please explain briefly different instance modes in wcf?

430


What are the advantages of hosting wcf services in iis as compared to self hosting?

457


What are the types of messaging patterns?

487


What is the "binding" property of endpoint in wcf?

449


Plz any one send the sharepoint interview question @ mossdev123@gmail.com

2567


what is a Service Proxy in windows Communication Foundation?

577


What is address in wcf and how many types of transport schemas are there in wcf?

467