Embedd_0913
Embedd_0913

Reputation: 16545

What are DataContracts in WCF?

What are DataContracts in WCF ? I have an XML file , how can I create a DataContract for this?

Upvotes: 2

Views: 315

Answers (3)

Hemant
Hemant

Reputation: 19826

How about referring a good book...

Upvotes: 0

Justin Niessner
Justin Niessner

Reputation: 245389

The DataContract is how you specify the format of the data that your service will provide/accept.

If you're used to working with .NET 2.0 Web Services and are familiar with the WSDL, you can think of it another way. The WSDL is primarily composed of two seperate WCF concepts:

The ServiceContract would compose the part of the WSDL that specified the service's endpionts.

The DataContract would compose the part of the WSDL that specified the format of the data to be passed in and returned from the service.

Upvotes: 3

Related Questions