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 are the Advantages of hosting wcf in iis?

509


What is ConcurrencyMode in WCF?

538


Why do we use wcf?

414


What is the difference between xmlserializer and the datacontractserializer?

506


How datacontractserializer different from xmlserializer?

479






do you know what is address in wcf and how many types of transport schemas are there in wcf? : Wcf data services

428


What is extension of WCF Service?

520


what is the difference between ASMX web services and WCF?

499


What are contracts in wcf?

570


What is wcf federated ws binding type?

444


Which specifications does wcf follow?

491


What is message contract in wcf?

490


Give the address format of all the bindings in wcf.

440


Why to use wcf?

479


what is SOA?

591