tips & tricks

aprile 2024

WCF Documentation

WCF Documentation



Indicates that an interface or a class defines a service contract in a Windows Communication Foundation (WCF) application. Use the ServiceContractAttribute attribute on an interface (or class) to define a service contract. Then use the OperationContractAttribute attribute on one or more of the class (or interface) methods to define the contract's service operations.




Indicates that a method defines an operation that is part of a service contract in a Windows Communication Foundation (WCF) application. Apply the OperationContractAttribute to a method to indicate that the method implements a service operation as part of a service contract (specified by a ServiceContractAttribute attribute). Use the OperationContractAttribute properties to control the structure of the operation and the values expressed in metadata:

·          The Action property specifies the action that uniquely identifies this operation. WCF dispatches request messages to methods based on their action.

·         The AsyncPattern property indicates that the operation is implemented or can be called asynchronously using a Begin/End method pair.

·         The HasProtectionLevel property indicates whether the ProtectionLevel property has been explicitly set.

·         The IsOneWay property indicates that the operation only consists of a single input message. The operation has no associated output message.

·         The IsInitiating property specifies whether this operation can be the initial operation in a session.

·         The IsTerminating property specifies whether WCF attempts to terminate the current session after the operation completes.

·         The ProtectionLevel property specifies the message-level security that an operation requires at run time.

·         The ReplyAction property specifies the action of the reply message for the operation.

Only methods attributed with the OperationContractAttribute are exposed as service operations. A service contract without any methods marked with the OperationContractAttribute exposes no operations.







Specifies that the type defines or implements a data contract and is serializable by a serializer.If you send or receive messages by using the Windows Communication Foundation (WCF) infrastructure, you should also apply the DataContractAttribute to any classes that hold and manipulate data sent in messages.

To create a data contract, simply apply the DataContractAttribute to the class and apply the DataMemberAttribute to any fields or properties that must be serialized. When serialized, the data conforms to the data contract that is implicitly built into the type.




When applied to the member of a type, specifies that the member is part of a data contract and is serializable by the DataContractSerializer. Applying the DataMemberAttribute to a field or property explicitly specifies that the member value will be serialized. In contrast, the BinaryFormatter serializes public and private fields of a type, and the XmlSerializer serializes only public fields and properties of a type.

Categoria: C#
giovedì, 10 lug 2008 Ore. 15.56
Archivio Posts
Anno 2020

Anno 2018

Anno 2015

Anno 2013

Anno 2011

Anno 2010

Anno 2009

Anno 2008
  • Views Home Page: 13.272
  • Views Posts: 55.937
  • Views Gallerie: 2.837
  • n° Posts: 117
  • n° Commenti: 1
Copyright © 2002-2007 - Blogs 2.0 | Home Page Blogs
ASP.NET 2.0 Windows 2003