Learning WCF Chapter2 WCF contracts and serialization

Source: Internet
Author: User

So far I ' ve talked about the standards behind it all,
But in fact, WCF hides most of the developer by providing a programming interface for designing service contracts and controlling the message format.
Application messaging Requirementsare described by contracts in WCF.
There is three types of formal contracts that clients and services rely on to control messaging.

The service contract describes the operations exposed by a particular service endpoint.
Each Operation,through parameters and return types,defines the format of the request and response messages.

A Data contract Describes how a complex type was serialized as part of a message.
Data contracts is the preferred to include complex types in a service contract.

A Message Contract provides control over the format of the entire SOAP message,
Including support for custom message headers and individual body elements the can is described by data contracts.

By Default,message serialization are handled by the DataContractSerializer.
This was a new serializer introduced with WCF, requires all types to opt-in their exact requirements for serialization- In compliance with SOA tenets.

The DataContractSerializer can serialize data contracts,message Contracts,and other serializable types such as those Marke D with the SerializableAttribute or those this inherit ixmlserializable (see Figure 2-2).

Figure 2-2. The DataContractSerializer can serialize message contracts, data contracts, and other serializable types


It is a also possible to-tell WCF-to-use the XmlSerializer, that ASP. NET Web services use (useful only in rare cases).
The XmlSerializer provides much less control over serialization in and the public members is serialized.
I ' ll discuss these and other serialization concepts later in this chapter.

As you complete the labs in this chapter,you would practice working with service Contracts,data contracts,message contracts , other serializable Types,and raw messages.
Throughout,i ' ll provide you and practical design Tips,discuss approaches in contract Versioning,and teach Ride default serialization behaviors.

SOAP, WSDL, and ws*
It is amazing-think about the simplicity of the early specifications:soap and WSDL.
By their simplicity,adoption is Promoted-web service platforms appeared left and right.
Interoperability issues quickly surfaced,forcing platform vendors to pay close attention to their XML parsers and SOAP Eng Ines to improve consistency on how XML schema and WSDL were interpreted.
In the Meantime,standards building on SOAP and WSDL emerged to deal with addressing and routing Scenarios,security,large b Inary attachments,reliable Messaging,transactions,policy,and more.
Like with SOAP and Wsdl,these advanced standards-collectively labeled ws*-cycle through phases of development and approval , Vendor Adoption,and Interoperability testing.
A Healthy collection of these advanced standards has been fully ratified by the Consortium (www.w3c.org) and OASIS (WWW.OASIS-OPEN.O RG),
While others is still in the development or approval process.

Learning WCF Chapter2 WCF contracts and serialization

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.