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
How to define a service as rest based service in wcf?
How to do authentication in wcf?
What is address in wcf and how many types of transport schemas are there in wcf?
Why wcf service is used?
Explain data contracts?
What do you understand by the term soap?
How do wcf works?
What is transport and message reliability?
What is the proxy for wcf service?
What are the protocols supported by wcf hosting environment?
Explain Address, Binding, and contract for a WCF Service?
Explain about msmq integration binding?
explain wcf ipc binding type? : Wcf data services
What is .svc file in wcf?
Can you explain how end points, contract, address and bindings are done in wcf?