One step at a time to learn the basic terms of the WCF series-1-contract (contract)

Source: Internet
Author: User

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
{
}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.