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 about contracts?

479


What is the difference between wcf service and web service?

471


How can we host wcf service?

473


What is the main advantage of was?

434


WCF:What is it the Teredo? How can we use it?

3080






explain wcf? : Wcf data services

458


WCF:Can the Reliable session be established with the one- way, or the request-reply, or with the duplex, or with all those exchange message patterns?

3624


What is the messaging pattern? Which messaging pattern wcf supports?

460


How would you enable the metadata information of the service?

479


List some of the different ways of hosting?

436


What is transfer security?

450


what are the main components of WCF?

490


What is .net 3.0?

450


What is wcf programming?

426


What are tha advantages of hosting wcf service in was?

475