zoukankan      html  css  js  c++  java
  • WCF Contracts

    In WCF, all services expose contracts. The contract is a platform-neutral and standard way of describing what the service does. WCF defines four types of contracts:

    Service contracts

    Describe which operations the client can perform on the service. 

    Data contracts

    Define which data types are passed to and from the service. WCF defines implicit contracts for built-in types such as int and string, but you can easily define explicit opt-in data contracts for custom types. 

    Fault contracts

    Define which errors are raised by the service and how the service handles and propagates errors to its clients. 

    Message contracts

    Allow the service to interact directly with messages. Message contracts can be typed or untyped and are useful in interoperability cases when another party has already dictated some explicit (typically proprietary) message format. This, however, is by no means the usual case for common WCF applications. Unless you are required to leverage the flexibility, power, and extensibility of message contracts, you should avoid them, as they add no value, but do add complexity. In many cases, the desire to use message contracts indicates a need for a custom application context, which you can address using custom headers .   

  • 相关阅读:
    约束性组件和非约束性组件
    react事件中的事件对象和常见事件
    react事件中的this指向
    【Java】操作数据库
    【设计思想】MVC模式
    【设计思想】面向对象
    【Java】(机考常用)类集
    【Java】机考常用操作
    【数据库】三级模式、二级映射
    【软件测试】圈复杂度
  • 原文地址:https://www.cnblogs.com/jiaruistone/p/1862808.html
Copyright © 2011-2022 走看看