Reading directory
I. Contract
Ii. Service Contract
Iii. How to define a service contract?
I. Contract)
All the services of WCF will be made public as a contract, which is a way to describe the service functions. For example, if you wear a school uniform, the school uniform will describe that you are a student in this school.
Ii. Service Contract)
The client can perform service operations. Today we only introduce the service contract features. For example, students in Guangming Primary school wear school uniforms, you can go to the school chess and card room to play chess during lunch break (you can go to the chess and card room to play chess is equivalent to performing service operations)
Iii. Define a service contract using the property definition method
Why is attribute definition? Because [servicecontract (name = "serviceacontract", namespace = "http://www.thatindigogirl.com/samples/2006/06")] It's not like when we do HTML width = "180px", Height = "200px ", it is called the attribute definition method.
4. How to define a service contract?
A service contract can only be defined on interfaces or classes and thus be defined as a WCF Service.
Definition:
[Servicecontract]
Interface imyinterface
{
}
Or
[Service contract]
Class myclass
{
}